CfnSpotFleet

class aws_cdk.aws_ec2.CfnSpotFleet(scope, id, *, spot_fleet_request_config_data)

Bases: CfnResource

Specifies a Spot Fleet request.

The Spot Fleet request specifies the total target capacity and the On-Demand target capacity. Amazon EC2 calculates the difference between the total capacity and On-Demand capacity, and launches the difference as Spot capacity.

You can submit a single request that includes multiple launch specifications that vary by instance type, AMI, Availability Zone, or subnet.

By default, the Spot Fleet requests Spot Instances in the Spot Instance pool where the price per unit is the lowest. Each launch specification can include its own instance weighting that reflects the value of the instance type to your application workload.

Alternatively, you can specify that the Spot Fleet distribute the target capacity across the Spot pools included in its launch specifications. By ensuring that the Spot Instances in your Spot Fleet are in different Spot pools, you can improve the availability of your fleet.

You can specify tags for the Spot Fleet request and instances launched by the fleet. You cannot tag other resource types in a Spot Fleet request because only the spot-fleet-request and instance resource types are supported.

For more information, see Spot Fleet in the Amazon EC2 User Guide .

See:

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

CloudformationResource:

AWS::EC2::SpotFleet

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_spot_fleet = ec2.CfnSpotFleet(self, "MyCfnSpotFleet",
    spot_fleet_request_config_data=ec2.CfnSpotFleet.SpotFleetRequestConfigDataProperty(
        iam_fleet_role="iamFleetRole",
        target_capacity=123,

        # the properties below are optional
        allocation_strategy="allocationStrategy",
        context="context",
        excess_capacity_termination_policy="excessCapacityTerminationPolicy",
        instance_interruption_behavior="instanceInterruptionBehavior",
        instance_pools_to_use_count=123,
        launch_specifications=[ec2.CfnSpotFleet.SpotFleetLaunchSpecificationProperty(
            image_id="imageId",

            # the properties below are optional
            block_device_mappings=[ec2.CfnSpotFleet.BlockDeviceMappingProperty(
                device_name="deviceName",

                # the properties below are optional
                ebs=ec2.CfnSpotFleet.EbsBlockDeviceProperty(
                    delete_on_termination=False,
                    encrypted=False,
                    iops=123,
                    snapshot_id="snapshotId",
                    volume_size=123,
                    volume_type="volumeType"
                ),
                no_device="noDevice",
                virtual_name="virtualName"
            )],
            ebs_optimized=False,
            iam_instance_profile=ec2.CfnSpotFleet.IamInstanceProfileSpecificationProperty(
                arn="arn"
            ),
            instance_requirements=ec2.CfnSpotFleet.InstanceRequirementsRequestProperty(
                accelerator_count=ec2.CfnSpotFleet.AcceleratorCountRequestProperty(
                    max=123,
                    min=123
                ),
                accelerator_manufacturers=["acceleratorManufacturers"],
                accelerator_names=["acceleratorNames"],
                accelerator_total_memory_mi_b=ec2.CfnSpotFleet.AcceleratorTotalMemoryMiBRequestProperty(
                    max=123,
                    min=123
                ),
                accelerator_types=["acceleratorTypes"],
                allowed_instance_types=["allowedInstanceTypes"],
                bare_metal="bareMetal",
                baseline_ebs_bandwidth_mbps=ec2.CfnSpotFleet.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.CfnSpotFleet.MemoryGiBPerVCpuRequestProperty(
                    max=123,
                    min=123
                ),
                memory_mi_b=ec2.CfnSpotFleet.MemoryMiBRequestProperty(
                    max=123,
                    min=123
                ),
                network_bandwidth_gbps=ec2.CfnSpotFleet.NetworkBandwidthGbpsRequestProperty(
                    max=123,
                    min=123
                ),
                network_interface_count=ec2.CfnSpotFleet.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.CfnSpotFleet.TotalLocalStorageGBRequestProperty(
                    max=123,
                    min=123
                ),
                v_cpu_count=ec2.CfnSpotFleet.VCpuCountRangeRequestProperty(
                    max=123,
                    min=123
                )
            ),
            instance_type="instanceType",
            kernel_id="kernelId",
            key_name="keyName",
            monitoring=ec2.CfnSpotFleet.SpotFleetMonitoringProperty(
                enabled=False
            ),
            network_interfaces=[ec2.CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty(
                associate_public_ip_address=False,
                delete_on_termination=False,
                description="description",
                device_index=123,
                groups=["groups"],
                ipv6_address_count=123,
                ipv6_addresses=[ec2.CfnSpotFleet.InstanceIpv6AddressProperty(
                    ipv6_address="ipv6Address"
                )],
                network_interface_id="networkInterfaceId",
                private_ip_addresses=[ec2.CfnSpotFleet.PrivateIpAddressSpecificationProperty(
                    private_ip_address="privateIpAddress",

                    # the properties below are optional
                    primary=False
                )],
                secondary_private_ip_address_count=123,
                subnet_id="subnetId"
            )],
            placement=ec2.CfnSpotFleet.SpotPlacementProperty(
                availability_zone="availabilityZone",
                group_name="groupName",
                tenancy="tenancy"
            ),
            ramdisk_id="ramdiskId",
            security_groups=[ec2.CfnSpotFleet.GroupIdentifierProperty(
                group_id="groupId"
            )],
            spot_price="spotPrice",
            subnet_id="subnetId",
            tag_specifications=[ec2.CfnSpotFleet.SpotFleetTagSpecificationProperty(
                resource_type="resourceType",
                tags=[CfnTag(
                    key="key",
                    value="value"
                )]
            )],
            user_data="userData",
            weighted_capacity=123
        )],
        launch_template_configs=[ec2.CfnSpotFleet.LaunchTemplateConfigProperty(
            launch_template_specification=ec2.CfnSpotFleet.FleetLaunchTemplateSpecificationProperty(
                version="version",

                # the properties below are optional
                launch_template_id="launchTemplateId",
                launch_template_name="launchTemplateName"
            ),
            overrides=[ec2.CfnSpotFleet.LaunchTemplateOverridesProperty(
                availability_zone="availabilityZone",
                instance_requirements=ec2.CfnSpotFleet.InstanceRequirementsRequestProperty(
                    accelerator_count=ec2.CfnSpotFleet.AcceleratorCountRequestProperty(
                        max=123,
                        min=123
                    ),
                    accelerator_manufacturers=["acceleratorManufacturers"],
                    accelerator_names=["acceleratorNames"],
                    accelerator_total_memory_mi_b=ec2.CfnSpotFleet.AcceleratorTotalMemoryMiBRequestProperty(
                        max=123,
                        min=123
                    ),
                    accelerator_types=["acceleratorTypes"],
                    allowed_instance_types=["allowedInstanceTypes"],
                    bare_metal="bareMetal",
                    baseline_ebs_bandwidth_mbps=ec2.CfnSpotFleet.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.CfnSpotFleet.MemoryGiBPerVCpuRequestProperty(
                        max=123,
                        min=123
                    ),
                    memory_mi_b=ec2.CfnSpotFleet.MemoryMiBRequestProperty(
                        max=123,
                        min=123
                    ),
                    network_bandwidth_gbps=ec2.CfnSpotFleet.NetworkBandwidthGbpsRequestProperty(
                        max=123,
                        min=123
                    ),
                    network_interface_count=ec2.CfnSpotFleet.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.CfnSpotFleet.TotalLocalStorageGBRequestProperty(
                        max=123,
                        min=123
                    ),
                    v_cpu_count=ec2.CfnSpotFleet.VCpuCountRangeRequestProperty(
                        max=123,
                        min=123
                    )
                ),
                instance_type="instanceType",
                priority=123,
                spot_price="spotPrice",
                subnet_id="subnetId",
                weighted_capacity=123
            )]
        )],
        load_balancers_config=ec2.CfnSpotFleet.LoadBalancersConfigProperty(
            classic_load_balancers_config=ec2.CfnSpotFleet.ClassicLoadBalancersConfigProperty(
                classic_load_balancers=[ec2.CfnSpotFleet.ClassicLoadBalancerProperty(
                    name="name"
                )]
            ),
            target_groups_config=ec2.CfnSpotFleet.TargetGroupsConfigProperty(
                target_groups=[ec2.CfnSpotFleet.TargetGroupProperty(
                    arn="arn"
                )]
            )
        ),
        on_demand_allocation_strategy="onDemandAllocationStrategy",
        on_demand_max_total_price="onDemandMaxTotalPrice",
        on_demand_target_capacity=123,
        replace_unhealthy_instances=False,
        spot_maintenance_strategies=ec2.CfnSpotFleet.SpotMaintenanceStrategiesProperty(
            capacity_rebalance=ec2.CfnSpotFleet.SpotCapacityRebalanceProperty(
                replacement_strategy="replacementStrategy",
                termination_delay=123
            )
        ),
        spot_max_total_price="spotMaxTotalPrice",
        spot_price="spotPrice",
        tag_specifications=[ec2.CfnSpotFleet.SpotFleetTagSpecificationProperty(
            resource_type="resourceType",
            tags=[CfnTag(
                key="key",
                value="value"
            )]
        )],
        target_capacity_unit_type="targetCapacityUnitType",
        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).

  • spot_fleet_request_config_data (Union[IResolvable, SpotFleetRequestConfigDataProperty, Dict[str, Any]]) – Describes the configuration of a Spot Fleet request.

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::SpotFleet'
attr_id

The ID of the Spot Fleet.

CloudformationAttribute:

Id

cfn_options

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

cfn_resource_type

AWS resource type.

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.

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.

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 }).

spot_fleet_request_config_data

Describes the configuration of a Spot Fleet request.

stack

The stack in which this element is defined.

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

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 CfnSpotFleet.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-spotfleet-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.CfnSpotFleet.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-spotfleet-acceleratorcountrequest.html#cfn-ec2-spotfleet-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-spotfleet-acceleratorcountrequest.html#cfn-ec2-spotfleet-acceleratorcountrequest-min

AcceleratorTotalMemoryMiBRequestProperty

class CfnSpotFleet.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-spotfleet-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.CfnSpotFleet.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-spotfleet-acceleratortotalmemorymibrequest.html#cfn-ec2-spotfleet-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-spotfleet-acceleratortotalmemorymibrequest.html#cfn-ec2-spotfleet-acceleratortotalmemorymibrequest-min

BaselineEbsBandwidthMbpsRequestProperty

class CfnSpotFleet.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-spotfleet-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.CfnSpotFleet.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-spotfleet-baselineebsbandwidthmbpsrequest.html#cfn-ec2-spotfleet-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-spotfleet-baselineebsbandwidthmbpsrequest.html#cfn-ec2-spotfleet-baselineebsbandwidthmbpsrequest-min

BlockDeviceMappingProperty

class CfnSpotFleet.BlockDeviceMappingProperty(*, device_name, ebs=None, no_device=None, virtual_name=None)

Bases: object

Specifies a block device mapping.

You can specify Ebs or VirtualName , but not both.

Parameters:
  • device_name (str) – The device name (for example, /dev/sdh or xvdh ).

  • ebs (Union[IResolvable, EbsBlockDeviceProperty, Dict[str, Any], None]) – Parameters used to automatically set up EBS volumes when the instance is launched.

  • no_device (Optional[str]) – To omit the device from the block device mapping, specify an empty string. When this property is specified, the device is removed from the block device mapping regardless of the assigned value.

  • virtual_name (Optional[str]) – The virtual device name ( ephemeral N). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1 . The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume. NVMe instance store volumes are automatically enumerated and assigned a device name. Including them in your block device mapping has no effect. Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-blockdevicemapping.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

block_device_mapping_property = ec2.CfnSpotFleet.BlockDeviceMappingProperty(
    device_name="deviceName",

    # the properties below are optional
    ebs=ec2.CfnSpotFleet.EbsBlockDeviceProperty(
        delete_on_termination=False,
        encrypted=False,
        iops=123,
        snapshot_id="snapshotId",
        volume_size=123,
        volume_type="volumeType"
    ),
    no_device="noDevice",
    virtual_name="virtualName"
)

Attributes

device_name

The device name (for example, /dev/sdh or xvdh ).

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-blockdevicemapping.html#cfn-ec2-spotfleet-blockdevicemapping-devicename

ebs

Parameters used to automatically set up EBS volumes when the instance is launched.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-blockdevicemapping.html#cfn-ec2-spotfleet-blockdevicemapping-ebs

no_device

To omit the device from the block device mapping, specify an empty string.

When this property is specified, the device is removed from the block device mapping regardless of the assigned value.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-blockdevicemapping.html#cfn-ec2-spotfleet-blockdevicemapping-nodevice

virtual_name

The virtual device name ( ephemeral N).

Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1 . The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.

NVMe instance store volumes are automatically enumerated and assigned a device name. Including them in your block device mapping has no effect.

Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-blockdevicemapping.html#cfn-ec2-spotfleet-blockdevicemapping-virtualname

ClassicLoadBalancerProperty

class CfnSpotFleet.ClassicLoadBalancerProperty(*, name)

Bases: object

Specifies a Classic Load Balancer.

Parameters:

name (str) – The name of the load balancer.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-classicloadbalancer.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

classic_load_balancer_property = ec2.CfnSpotFleet.ClassicLoadBalancerProperty(
    name="name"
)

Attributes

name

The name of the load balancer.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-classicloadbalancer.html#cfn-ec2-spotfleet-classicloadbalancer-name

ClassicLoadBalancersConfigProperty

class CfnSpotFleet.ClassicLoadBalancersConfigProperty(*, classic_load_balancers)

Bases: object

Specifies the Classic Load Balancers to attach to a Spot Fleet.

Spot Fleet registers the running Spot Instances with these Classic Load Balancers.

Parameters:

classic_load_balancers (Union[IResolvable, Sequence[Union[IResolvable, ClassicLoadBalancerProperty, Dict[str, Any]]]]) – One or more Classic Load Balancers.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-classicloadbalancersconfig.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

classic_load_balancers_config_property = ec2.CfnSpotFleet.ClassicLoadBalancersConfigProperty(
    classic_load_balancers=[ec2.CfnSpotFleet.ClassicLoadBalancerProperty(
        name="name"
    )]
)

Attributes

classic_load_balancers

One or more Classic Load Balancers.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-classicloadbalancersconfig.html#cfn-ec2-spotfleet-classicloadbalancersconfig-classicloadbalancers

EbsBlockDeviceProperty

class CfnSpotFleet.EbsBlockDeviceProperty(*, delete_on_termination=None, encrypted=None, iops=None, snapshot_id=None, volume_size=None, volume_type=None)

Bases: object

Describes a block device for an EBS volume.

Parameters:
  • delete_on_termination (Union[bool, IResolvable, None]) – Indicates whether the EBS volume is deleted on instance termination. For more information, see Preserving Amazon EBS volumes on instance termination in the Amazon EC2 User Guide .

  • encrypted (Union[bool, IResolvable, None]) – Indicates whether the encryption state of an EBS volume is changed while being restored from a backing snapshot. The effect of setting the encryption state to true depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Amazon EBS Encryption in the Amazon EC2 User Guide . In no case can you remove encryption from an encrypted volume. Encrypted volumes can only be attached to instances that support Amazon EBS encryption. For more information, see Supported Instance Types . This parameter is not returned by DescribeImageAttribute .

  • iops (Union[int, float, None]) – The number of I/O operations per second (IOPS). For gp3 , io1 , and io2 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. The following are the supported values for each volume type: - gp3 : 3,000 - 16,000 IOPS - io1 : 100 - 64,000 IOPS - io2 : 100 - 256,000 IOPS For io2 volumes, you can achieve up to 256,000 IOPS on instances built on the Nitro System . On other instances, you can achieve performance up to 32,000 IOPS. This parameter is required for io1 and io2 volumes. The default for gp3 volumes is 3,000 IOPS.

  • snapshot_id (Optional[str]) – The ID of the snapshot.

  • volume_size (Union[int, float, None]) – The size of the volume, in GiBs. You must specify either a snapshot ID or a volume size. If you specify a snapshot, the default is the snapshot size. You can specify a volume size that is equal to or larger than the snapshot size. The following are the supported sizes for each volume type: - gp2 and gp3 : 1 - 16,384 GiB - io1 : 4 - 16,384 GiB - io2 : 4 - 65,536 GiB - st1 and sc1 : 125 - 16,384 GiB - standard : 1 - 1024 GiB

  • volume_type (Optional[str]) – The volume type. For more information, see Amazon EBS volume types in the Amazon EBS User Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-ebsblockdevice.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

ebs_block_device_property = ec2.CfnSpotFleet.EbsBlockDeviceProperty(
    delete_on_termination=False,
    encrypted=False,
    iops=123,
    snapshot_id="snapshotId",
    volume_size=123,
    volume_type="volumeType"
)

Attributes

delete_on_termination

Indicates whether the EBS volume is deleted on instance termination.

For more information, see Preserving Amazon EBS volumes on instance termination in the Amazon EC2 User Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-ebsblockdevice.html#cfn-ec2-spotfleet-ebsblockdevice-deleteontermination

encrypted

Indicates whether the encryption state of an EBS volume is changed while being restored from a backing snapshot.

The effect of setting the encryption state to true depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Amazon EBS Encryption in the Amazon EC2 User Guide .

In no case can you remove encryption from an encrypted volume.

Encrypted volumes can only be attached to instances that support Amazon EBS encryption. For more information, see Supported Instance Types .

This parameter is not returned by DescribeImageAttribute .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-ebsblockdevice.html#cfn-ec2-spotfleet-ebsblockdevice-encrypted

iops

The number of I/O operations per second (IOPS).

For gp3 , io1 , and io2 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting.

The following are the supported values for each volume type:

  • gp3 : 3,000 - 16,000 IOPS

  • io1 : 100 - 64,000 IOPS

  • io2 : 100 - 256,000 IOPS

For io2 volumes, you can achieve up to 256,000 IOPS on instances built on the Nitro System . On other instances, you can achieve performance up to 32,000 IOPS.

This parameter is required for io1 and io2 volumes. The default for gp3 volumes is 3,000 IOPS.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-ebsblockdevice.html#cfn-ec2-spotfleet-ebsblockdevice-iops

snapshot_id

The ID of the snapshot.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-ebsblockdevice.html#cfn-ec2-spotfleet-ebsblockdevice-snapshotid

volume_size

The size of the volume, in GiBs.

You must specify either a snapshot ID or a volume size. If you specify a snapshot, the default is the snapshot size. You can specify a volume size that is equal to or larger than the snapshot size.

The following are the supported sizes for each volume type:

  • gp2 and gp3 : 1 - 16,384 GiB

  • io1 : 4 - 16,384 GiB

  • io2 : 4 - 65,536 GiB

  • st1 and sc1 : 125 - 16,384 GiB

  • standard : 1 - 1024 GiB

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-ebsblockdevice.html#cfn-ec2-spotfleet-ebsblockdevice-volumesize

volume_type

The volume type.

For more information, see Amazon EBS volume types in the Amazon EBS User Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-ebsblockdevice.html#cfn-ec2-spotfleet-ebsblockdevice-volumetype

FleetLaunchTemplateSpecificationProperty

class CfnSpotFleet.FleetLaunchTemplateSpecificationProperty(*, version, launch_template_id=None, launch_template_name=None)

Bases: object

Specifies the launch template to be used by the Spot Fleet request 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.

FleetLaunchTemplateSpecification is a property of the AWS::EC2::SpotFleet resource.

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 version number of the launch template. Specifying $Latest or $Default for the template version number is not supported. However, you can specify LatestVersionNumber or DefaultVersionNumber using the Fn::GetAtt intrinsic function. For more information, see Fn::GetAtt .

  • 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-spotfleet-fleetlaunchtemplatespecification.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_property = ec2.CfnSpotFleet.FleetLaunchTemplateSpecificationProperty(
    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-spotfleet-fleetlaunchtemplatespecification.html#cfn-ec2-spotfleet-fleetlaunchtemplatespecification-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-spotfleet-fleetlaunchtemplatespecification.html#cfn-ec2-spotfleet-fleetlaunchtemplatespecification-launchtemplatename

version

The version number of the launch template.

Specifying $Latest or $Default for the template version number is not supported. However, you can specify LatestVersionNumber or DefaultVersionNumber using the Fn::GetAtt intrinsic function. For more information, see Fn::GetAtt .

See:

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

GroupIdentifierProperty

class CfnSpotFleet.GroupIdentifierProperty(*, group_id)

Bases: object

Describes a security group.

Parameters:

group_id (str) – The ID of the security group.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-groupidentifier.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

group_identifier_property = ec2.CfnSpotFleet.GroupIdentifierProperty(
    group_id="groupId"
)

Attributes

group_id

The ID of the security group.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-groupidentifier.html#cfn-ec2-spotfleet-groupidentifier-groupid

IamInstanceProfileSpecificationProperty

class CfnSpotFleet.IamInstanceProfileSpecificationProperty(*, arn=None)

Bases: object

Describes an IAM instance profile.

Parameters:

arn (Optional[str]) – The Amazon Resource Name (ARN) of the instance profile.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-iaminstanceprofilespecification.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

iam_instance_profile_specification_property = ec2.CfnSpotFleet.IamInstanceProfileSpecificationProperty(
    arn="arn"
)

Attributes

arn

The Amazon Resource Name (ARN) of the instance profile.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-iaminstanceprofilespecification.html#cfn-ec2-spotfleet-iaminstanceprofilespecification-arn

InstanceIpv6AddressProperty

class CfnSpotFleet.InstanceIpv6AddressProperty(*, ipv6_address)

Bases: object

Describes an IPv6 address.

Parameters:

ipv6_address (str) – The IPv6 address.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-instanceipv6address.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_ipv6_address_property = ec2.CfnSpotFleet.InstanceIpv6AddressProperty(
    ipv6_address="ipv6Address"
)

Attributes

ipv6_address

The IPv6 address.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-instanceipv6address.html#cfn-ec2-spotfleet-instanceipv6address-ipv6address

InstanceNetworkInterfaceSpecificationProperty

class CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty(*, associate_public_ip_address=None, delete_on_termination=None, description=None, device_index=None, groups=None, ipv6_address_count=None, ipv6_addresses=None, network_interface_id=None, private_ip_addresses=None, secondary_private_ip_address_count=None, subnet_id=None)

Bases: object

Describes a network interface.

Parameters:
  • associate_public_ip_address (Union[bool, IResolvable, None]) – Indicates whether to assign a public IPv4 address to an instance you launch in a VPC. The public IP address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value is true . AWS charges for all public IPv4 addresses, including public IPv4 addresses associated with running instances and Elastic IP addresses. For more information, see the Public IPv4 Address tab on the Amazon VPC pricing page .

  • delete_on_termination (Union[bool, IResolvable, None]) – Indicates whether the network interface is deleted when the instance is terminated.

  • description (Optional[str]) – The description of the network interface. Applies only if creating a network interface when launching an instance.

  • device_index (Union[int, float, None]) – The position of the network interface in the attachment order. A primary network interface has a device index of 0. If you specify a network interface when launching an instance, you must specify the device index.

  • groups (Optional[Sequence[str]]) – The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.

  • ipv6_address_count (Union[int, float, None]) – A number of IPv6 addresses to assign to the network interface. Amazon EC2 chooses the IPv6 addresses from the range of the subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you’ve specified a minimum number of instances to launch.

  • ipv6_addresses (Union[IResolvable, Sequence[Union[IResolvable, InstanceIpv6AddressProperty, Dict[str, Any]]], None]) – The IPv6 addresses to assign to the network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you’ve specified a minimum number of instances to launch.

  • network_interface_id (Optional[str]) – The ID of the network interface. If you are creating a Spot Fleet, omit this parameter because you can’t specify a network interface ID in a launch specification.

  • private_ip_addresses (Union[IResolvable, Sequence[Union[IResolvable, PrivateIpAddressSpecificationProperty, Dict[str, Any]]], None]) – The private IPv4 addresses to assign to the network interface. Only one private IPv4 address can be designated as primary. You cannot specify this option if you’re launching more than one instance in a RunInstances request.

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

    The number of secondary private IPv4 addresses. You can’t specify this option and specify more than one private IP address using the private IP addresses option. You cannot specify this option if you’re launching more than one instance in a RunInstances request.

  • subnet_id (Optional[str]) – The ID of the subnet associated with the network interface.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-instancenetworkinterfacespecification.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_network_interface_specification_property = ec2.CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty(
    associate_public_ip_address=False,
    delete_on_termination=False,
    description="description",
    device_index=123,
    groups=["groups"],
    ipv6_address_count=123,
    ipv6_addresses=[ec2.CfnSpotFleet.InstanceIpv6AddressProperty(
        ipv6_address="ipv6Address"
    )],
    network_interface_id="networkInterfaceId",
    private_ip_addresses=[ec2.CfnSpotFleet.PrivateIpAddressSpecificationProperty(
        private_ip_address="privateIpAddress",

        # the properties below are optional
        primary=False
    )],
    secondary_private_ip_address_count=123,
    subnet_id="subnetId"
)

Attributes

associate_public_ip_address

Indicates whether to assign a public IPv4 address to an instance you launch in a VPC.

The public IP address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value is true .

AWS charges for all public IPv4 addresses, including public IPv4 addresses associated with running instances and Elastic IP addresses. For more information, see the Public IPv4 Address tab on the Amazon VPC pricing page .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-instancenetworkinterfacespecification.html#cfn-ec2-spotfleet-instancenetworkinterfacespecification-associatepublicipaddress

delete_on_termination

Indicates whether the network interface is deleted when the instance is terminated.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-instancenetworkinterfacespecification.html#cfn-ec2-spotfleet-instancenetworkinterfacespecification-deleteontermination

description

The description of the network interface.

Applies only if creating a network interface when launching an instance.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-instancenetworkinterfacespecification.html#cfn-ec2-spotfleet-instancenetworkinterfacespecification-description

device_index

The position of the network interface in the attachment order.

A primary network interface has a device index of 0.

If you specify a network interface when launching an instance, you must specify the device index.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-instancenetworkinterfacespecification.html#cfn-ec2-spotfleet-instancenetworkinterfacespecification-deviceindex

groups

The IDs of the security groups for the network interface.

Applies only if creating a network interface when launching an instance.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-instancenetworkinterfacespecification.html#cfn-ec2-spotfleet-instancenetworkinterfacespecification-groups

ipv6_address_count

A number of IPv6 addresses to assign to the network interface.

Amazon EC2 chooses the IPv6 addresses from the range of the subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you’ve specified a minimum number of instances to launch.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-instancenetworkinterfacespecification.html#cfn-ec2-spotfleet-instancenetworkinterfacespecification-ipv6addresscount

ipv6_addresses

The IPv6 addresses to assign to the network interface.

You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you’ve specified a minimum number of instances to launch.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-instancenetworkinterfacespecification.html#cfn-ec2-spotfleet-instancenetworkinterfacespecification-ipv6addresses

network_interface_id

The ID of the network interface.

If you are creating a Spot Fleet, omit this parameter because you can’t specify a network interface ID in a launch specification.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-instancenetworkinterfacespecification.html#cfn-ec2-spotfleet-instancenetworkinterfacespecification-networkinterfaceid

private_ip_addresses

The private IPv4 addresses to assign to the network interface.

Only one private IPv4 address can be designated as primary. You cannot specify this option if you’re launching more than one instance in a RunInstances request.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-instancenetworkinterfacespecification.html#cfn-ec2-spotfleet-instancenetworkinterfacespecification-privateipaddresses

secondary_private_ip_address_count

The number of secondary private IPv4 addresses.

You can’t specify this option and specify more than one private IP address using the private IP addresses option. You cannot specify this option if you’re launching more than one instance in a RunInstances request.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-instancenetworkinterfacespecification.html#cfn-ec2-spotfleet-instancenetworkinterfacespecification-secondaryprivateipaddresscount

subnet_id

The ID of the subnet associated with the network interface.

See:

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

InstanceRequirementsRequestProperty

class CfnSpotFleet.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 Specify attributes for instance type selection for EC2 Fleet or 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 . 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 TargetCapacityUnitType 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-spotfleet-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.CfnSpotFleet.InstanceRequirementsRequestProperty(
    accelerator_count=ec2.CfnSpotFleet.AcceleratorCountRequestProperty(
        max=123,
        min=123
    ),
    accelerator_manufacturers=["acceleratorManufacturers"],
    accelerator_names=["acceleratorNames"],
    accelerator_total_memory_mi_b=ec2.CfnSpotFleet.AcceleratorTotalMemoryMiBRequestProperty(
        max=123,
        min=123
    ),
    accelerator_types=["acceleratorTypes"],
    allowed_instance_types=["allowedInstanceTypes"],
    bare_metal="bareMetal",
    baseline_ebs_bandwidth_mbps=ec2.CfnSpotFleet.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.CfnSpotFleet.MemoryGiBPerVCpuRequestProperty(
        max=123,
        min=123
    ),
    memory_mi_b=ec2.CfnSpotFleet.MemoryMiBRequestProperty(
        max=123,
        min=123
    ),
    network_bandwidth_gbps=ec2.CfnSpotFleet.NetworkBandwidthGbpsRequestProperty(
        max=123,
        min=123
    ),
    network_interface_count=ec2.CfnSpotFleet.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.CfnSpotFleet.TotalLocalStorageGBRequestProperty(
        max=123,
        min=123
    ),
    v_cpu_count=ec2.CfnSpotFleet.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-spotfleet-instancerequirementsrequest.html#cfn-ec2-spotfleet-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-spotfleet-instancerequirementsrequest.html#cfn-ec2-spotfleet-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-spotfleet-instancerequirementsrequest.html#cfn-ec2-spotfleet-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-spotfleet-instancerequirementsrequest.html#cfn-ec2-spotfleet-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 .

Default: Any accelerator type

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-instancerequirementsrequest.html#cfn-ec2-spotfleet-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-spotfleet-instancerequirementsrequest.html#cfn-ec2-spotfleet-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-spotfleet-instancerequirementsrequest.html#cfn-ec2-spotfleet-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-spotfleet-instancerequirementsrequest.html#cfn-ec2-spotfleet-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-spotfleet-instancerequirementsrequest.html#cfn-ec2-spotfleet-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-spotfleet-instancerequirementsrequest.html#cfn-ec2-spotfleet-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-spotfleet-instancerequirementsrequest.html#cfn-ec2-spotfleet-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-spotfleet-instancerequirementsrequest.html#cfn-ec2-spotfleet-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-spotfleet-instancerequirementsrequest.html#cfn-ec2-spotfleet-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-spotfleet-instancerequirementsrequest.html#cfn-ec2-spotfleet-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 TargetCapacityUnitType 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-spotfleet-instancerequirementsrequest.html#cfn-ec2-spotfleet-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-spotfleet-instancerequirementsrequest.html#cfn-ec2-spotfleet-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-spotfleet-instancerequirementsrequest.html#cfn-ec2-spotfleet-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-spotfleet-instancerequirementsrequest.html#cfn-ec2-spotfleet-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-spotfleet-instancerequirementsrequest.html#cfn-ec2-spotfleet-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-spotfleet-instancerequirementsrequest.html#cfn-ec2-spotfleet-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-spotfleet-instancerequirementsrequest.html#cfn-ec2-spotfleet-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-spotfleet-instancerequirementsrequest.html#cfn-ec2-spotfleet-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-spotfleet-instancerequirementsrequest.html#cfn-ec2-spotfleet-instancerequirementsrequest-totallocalstoragegb

v_cpu_count

The minimum and maximum number of vCPUs.

See:

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

LaunchTemplateConfigProperty

class CfnSpotFleet.LaunchTemplateConfigProperty(*, launch_template_specification=None, overrides=None)

Bases: object

Specifies a launch template and overrides.

Parameters:
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-launchtemplateconfig.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

launch_template_config_property = ec2.CfnSpotFleet.LaunchTemplateConfigProperty(
    launch_template_specification=ec2.CfnSpotFleet.FleetLaunchTemplateSpecificationProperty(
        version="version",

        # the properties below are optional
        launch_template_id="launchTemplateId",
        launch_template_name="launchTemplateName"
    ),
    overrides=[ec2.CfnSpotFleet.LaunchTemplateOverridesProperty(
        availability_zone="availabilityZone",
        instance_requirements=ec2.CfnSpotFleet.InstanceRequirementsRequestProperty(
            accelerator_count=ec2.CfnSpotFleet.AcceleratorCountRequestProperty(
                max=123,
                min=123
            ),
            accelerator_manufacturers=["acceleratorManufacturers"],
            accelerator_names=["acceleratorNames"],
            accelerator_total_memory_mi_b=ec2.CfnSpotFleet.AcceleratorTotalMemoryMiBRequestProperty(
                max=123,
                min=123
            ),
            accelerator_types=["acceleratorTypes"],
            allowed_instance_types=["allowedInstanceTypes"],
            bare_metal="bareMetal",
            baseline_ebs_bandwidth_mbps=ec2.CfnSpotFleet.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.CfnSpotFleet.MemoryGiBPerVCpuRequestProperty(
                max=123,
                min=123
            ),
            memory_mi_b=ec2.CfnSpotFleet.MemoryMiBRequestProperty(
                max=123,
                min=123
            ),
            network_bandwidth_gbps=ec2.CfnSpotFleet.NetworkBandwidthGbpsRequestProperty(
                max=123,
                min=123
            ),
            network_interface_count=ec2.CfnSpotFleet.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.CfnSpotFleet.TotalLocalStorageGBRequestProperty(
                max=123,
                min=123
            ),
            v_cpu_count=ec2.CfnSpotFleet.VCpuCountRangeRequestProperty(
                max=123,
                min=123
            )
        ),
        instance_type="instanceType",
        priority=123,
        spot_price="spotPrice",
        subnet_id="subnetId",
        weighted_capacity=123
    )]
)

Attributes

launch_template_specification

The launch template to use.

Make sure that the launch template does not contain the NetworkInterfaceId parameter because you can’t specify a network interface ID in a Spot Fleet.

See:

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

overrides

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

See:

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

LaunchTemplateOverridesProperty

class CfnSpotFleet.LaunchTemplateOverridesProperty(*, availability_zone=None, instance_requirements=None, instance_type=None, priority=None, spot_price=None, subnet_id=None, weighted_capacity=None)

Bases: object

Specifies overrides for a launch template.

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

  • instance_requirements (Union[IResolvable, InstanceRequirementsRequestProperty, Dict[str, Any], None]) – The instance requirements. When you specify instance requirements, Amazon EC2 will identify instance types with the provided requirements, and then use your On-Demand and Spot allocation strategies to launch instances from these instance types, in the same way as when you specify a list of instance types. .. epigraph:: If you specify InstanceRequirements , you can’t specify InstanceType .

  • instance_type (Optional[str]) – The instance type.

  • priority (Union[int, float, None]) – The priority for the launch template override. The highest priority is launched first. If OnDemandAllocationStrategy is set to prioritized , Spot Fleet uses priority to determine which launch template override to use first in fulfilling On-Demand capacity. If the Spot AllocationStrategy is set to capacityOptimizedPrioritized , Spot 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.

  • spot_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.

  • subnet_id (Optional[str]) – The ID of the subnet in which to launch the instances.

  • weighted_capacity (Union[int, float, None]) – The number of units provided by the specified instance type. These are the same units that you chose to set the target capacity in terms of instances, or a performance characteristic such as vCPUs, memory, or I/O. If the target capacity divided by this value is not a whole number, Amazon EC2 rounds the number of instances to the next whole number. If this value is not specified, the default is 1. .. epigraph:: When specifying weights, the price used in the lowestPrice and priceCapacityOptimized 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-spotfleet-launchtemplateoverrides.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

launch_template_overrides_property = ec2.CfnSpotFleet.LaunchTemplateOverridesProperty(
    availability_zone="availabilityZone",
    instance_requirements=ec2.CfnSpotFleet.InstanceRequirementsRequestProperty(
        accelerator_count=ec2.CfnSpotFleet.AcceleratorCountRequestProperty(
            max=123,
            min=123
        ),
        accelerator_manufacturers=["acceleratorManufacturers"],
        accelerator_names=["acceleratorNames"],
        accelerator_total_memory_mi_b=ec2.CfnSpotFleet.AcceleratorTotalMemoryMiBRequestProperty(
            max=123,
            min=123
        ),
        accelerator_types=["acceleratorTypes"],
        allowed_instance_types=["allowedInstanceTypes"],
        bare_metal="bareMetal",
        baseline_ebs_bandwidth_mbps=ec2.CfnSpotFleet.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.CfnSpotFleet.MemoryGiBPerVCpuRequestProperty(
            max=123,
            min=123
        ),
        memory_mi_b=ec2.CfnSpotFleet.MemoryMiBRequestProperty(
            max=123,
            min=123
        ),
        network_bandwidth_gbps=ec2.CfnSpotFleet.NetworkBandwidthGbpsRequestProperty(
            max=123,
            min=123
        ),
        network_interface_count=ec2.CfnSpotFleet.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.CfnSpotFleet.TotalLocalStorageGBRequestProperty(
            max=123,
            min=123
        ),
        v_cpu_count=ec2.CfnSpotFleet.VCpuCountRangeRequestProperty(
            max=123,
            min=123
        )
    ),
    instance_type="instanceType",
    priority=123,
    spot_price="spotPrice",
    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-spotfleet-launchtemplateoverrides.html#cfn-ec2-spotfleet-launchtemplateoverrides-availabilityzone

instance_requirements

The instance requirements.

When you specify instance requirements, Amazon EC2 will identify instance types with the provided requirements, and then use your On-Demand and Spot allocation strategies to launch instances from these instance types, in the same way as when you specify a list of instance types. .. epigraph:

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

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

instance_type

The instance type.

See:

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

priority

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

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

If the Spot AllocationStrategy is set to capacityOptimizedPrioritized , Spot 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-spotfleet-launchtemplateoverrides.html#cfn-ec2-spotfleet-launchtemplateoverrides-priority

spot_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-spotfleet-launchtemplateoverrides.html#cfn-ec2-spotfleet-launchtemplateoverrides-spotprice

subnet_id

The ID of the subnet in which to launch the instances.

See:

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

weighted_capacity

The number of units provided by the specified instance type.

These are the same units that you chose to set the target capacity in terms of instances, or a performance characteristic such as vCPUs, memory, or I/O.

If the target capacity divided by this value is not a whole number, Amazon EC2 rounds the number of instances to the next whole number. If this value is not specified, the default is 1. .. epigraph:

When specifying weights, the price used in the ``lowestPrice`` and ``priceCapacityOptimized`` 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-spotfleet-launchtemplateoverrides.html#cfn-ec2-spotfleet-launchtemplateoverrides-weightedcapacity

LoadBalancersConfigProperty

class CfnSpotFleet.LoadBalancersConfigProperty(*, classic_load_balancers_config=None, target_groups_config=None)

Bases: object

Specifies the Classic Load Balancers and target groups to attach to a Spot Fleet request.

Parameters:
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-loadbalancersconfig.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

load_balancers_config_property = ec2.CfnSpotFleet.LoadBalancersConfigProperty(
    classic_load_balancers_config=ec2.CfnSpotFleet.ClassicLoadBalancersConfigProperty(
        classic_load_balancers=[ec2.CfnSpotFleet.ClassicLoadBalancerProperty(
            name="name"
        )]
    ),
    target_groups_config=ec2.CfnSpotFleet.TargetGroupsConfigProperty(
        target_groups=[ec2.CfnSpotFleet.TargetGroupProperty(
            arn="arn"
        )]
    )
)

Attributes

classic_load_balancers_config

The Classic Load Balancers.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-loadbalancersconfig.html#cfn-ec2-spotfleet-loadbalancersconfig-classicloadbalancersconfig

target_groups_config

The target groups.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-loadbalancersconfig.html#cfn-ec2-spotfleet-loadbalancersconfig-targetgroupsconfig

MemoryGiBPerVCpuRequestProperty

class CfnSpotFleet.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-spotfleet-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.CfnSpotFleet.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-spotfleet-memorygibpervcpurequest.html#cfn-ec2-spotfleet-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-spotfleet-memorygibpervcpurequest.html#cfn-ec2-spotfleet-memorygibpervcpurequest-min

MemoryMiBRequestProperty

class CfnSpotFleet.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-spotfleet-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.CfnSpotFleet.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-spotfleet-memorymibrequest.html#cfn-ec2-spotfleet-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-spotfleet-memorymibrequest.html#cfn-ec2-spotfleet-memorymibrequest-min

NetworkBandwidthGbpsRequestProperty

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

Bases: object

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

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-spotfleet-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.CfnSpotFleet.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-spotfleet-networkbandwidthgbpsrequest.html#cfn-ec2-spotfleet-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-spotfleet-networkbandwidthgbpsrequest.html#cfn-ec2-spotfleet-networkbandwidthgbpsrequest-min

NetworkInterfaceCountRequestProperty

class CfnSpotFleet.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-spotfleet-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.CfnSpotFleet.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-spotfleet-networkinterfacecountrequest.html#cfn-ec2-spotfleet-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-spotfleet-networkinterfacecountrequest.html#cfn-ec2-spotfleet-networkinterfacecountrequest-min

PrivateIpAddressSpecificationProperty

class CfnSpotFleet.PrivateIpAddressSpecificationProperty(*, private_ip_address, primary=None)

Bases: object

Describes a secondary private IPv4 address for a network interface.

Parameters:
  • private_ip_address (str) – The private IPv4 address.

  • primary (Union[bool, IResolvable, None]) – Indicates whether the private IPv4 address is the primary private IPv4 address. Only one IPv4 address can be designated as primary.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-privateipaddressspecification.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

private_ip_address_specification_property = ec2.CfnSpotFleet.PrivateIpAddressSpecificationProperty(
    private_ip_address="privateIpAddress",

    # the properties below are optional
    primary=False
)

Attributes

primary

Indicates whether the private IPv4 address is the primary private IPv4 address.

Only one IPv4 address can be designated as primary.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-privateipaddressspecification.html#cfn-ec2-spotfleet-privateipaddressspecification-primary

private_ip_address

The private IPv4 address.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-privateipaddressspecification.html#cfn-ec2-spotfleet-privateipaddressspecification-privateipaddress

SpotCapacityRebalanceProperty

class CfnSpotFleet.SpotCapacityRebalanceProperty(*, replacement_strategy=None, termination_delay=None)

Bases: object

The Spot Instance replacement strategy to use when Amazon EC2 emits a 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 - Spot Fleet launches a new replacement Spot Instance when a rebalance notification is emitted for an existing Spot Instance in the fleet. Spot 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 - Spot Fleet launches a new 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-spotfleet-spotcapacityrebalance.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_capacity_rebalance_property = ec2.CfnSpotFleet.SpotCapacityRebalanceProperty(
    replacement_strategy="replacementStrategy",
    termination_delay=123
)

Attributes

replacement_strategy

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

launch - Spot Fleet launches a new replacement Spot Instance when a rebalance notification is emitted for an existing Spot Instance in the fleet. Spot 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 - Spot Fleet launches a new 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-spotfleet-spotcapacityrebalance.html#cfn-ec2-spotfleet-spotcapacityrebalance-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-spotfleet-spotcapacityrebalance.html#cfn-ec2-spotfleet-spotcapacityrebalance-terminationdelay

SpotFleetLaunchSpecificationProperty

class CfnSpotFleet.SpotFleetLaunchSpecificationProperty(*, image_id, block_device_mappings=None, ebs_optimized=None, iam_instance_profile=None, instance_requirements=None, instance_type=None, kernel_id=None, key_name=None, monitoring=None, network_interfaces=None, placement=None, ramdisk_id=None, security_groups=None, spot_price=None, subnet_id=None, tag_specifications=None, user_data=None, weighted_capacity=None)

Bases: object

Specifies the launch specification for one or more Spot Instances.

If you include On-Demand capacity in your fleet request, you can’t use SpotFleetLaunchSpecification ; you must use LaunchTemplateConfig .

Parameters:
  • image_id (str) – The ID of the AMI.

  • block_device_mappings (Union[IResolvable, Sequence[Union[IResolvable, BlockDeviceMappingProperty, Dict[str, Any]]], None]) – One or more block devices that are mapped to the Spot Instances. You can’t specify both a snapshot ID and an encryption value. This is because only blank volumes can be encrypted on creation. If a snapshot is the basis for a volume, it is not blank and its encryption status is used for the volume encryption status.

  • ebs_optimized (Union[bool, IResolvable, None]) – Indicates whether the instances are optimized for EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn’t available with all instance types. Additional usage charges apply when using an EBS Optimized instance. Default: false Default: - false

  • iam_instance_profile (Union[IResolvable, IamInstanceProfileSpecificationProperty, Dict[str, Any], None]) – The IAM instance profile.

  • 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.

  • kernel_id (Optional[str]) – The ID of the kernel.

  • key_name (Optional[str]) – The name of the key pair.

  • monitoring (Union[IResolvable, SpotFleetMonitoringProperty, Dict[str, Any], None]) – Enable or disable monitoring for the instances.

  • network_interfaces (Union[IResolvable, Sequence[Union[IResolvable, InstanceNetworkInterfaceSpecificationProperty, Dict[str, Any]]], None]) – The network interfaces.

  • placement (Union[IResolvable, SpotPlacementProperty, Dict[str, Any], None]) – The placement information.

  • ramdisk_id (Optional[str]) – The ID of the RAM disk. Some kernels require additional drivers at launch. Check the kernel requirements for information about whether you need to specify a RAM disk. To find kernel requirements, refer to the AWS Resource Center and search for the kernel ID.

  • security_groups (Union[IResolvable, Sequence[Union[IResolvable, GroupIdentifierProperty, Dict[str, Any]]], None]) – The security groups. If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.

  • spot_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.

  • subnet_id (Optional[str]) – The IDs of the subnets in which to launch the instances. To specify multiple subnets, separate them using commas; for example, “subnet-1234abcdeexample1, subnet-0987cdef6example2”. If you specify a network interface, you must specify any subnets as part of the network interface instead of using this parameter.

  • tag_specifications (Union[IResolvable, Sequence[Union[IResolvable, SpotFleetTagSpecificationProperty, Dict[str, Any]]], None]) – The tags to apply during creation.

  • user_data (Optional[str]) – The base64-encoded user data that instances use when starting up. User data is limited to 16 KB.

  • weighted_capacity (Union[int, float, None]) – The number of units provided by the specified instance type. These are the same units that you chose to set the target capacity in terms of instances, or a performance characteristic such as vCPUs, memory, or I/O. If the target capacity divided by this value is not a whole number, Amazon EC2 rounds the number of instances to the next whole number. If this value is not specified, the default is 1. .. epigraph:: When specifying weights, the price used in the lowestPrice and priceCapacityOptimized 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-spotfleet-spotfleetlaunchspecification.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_fleet_launch_specification_property = ec2.CfnSpotFleet.SpotFleetLaunchSpecificationProperty(
    image_id="imageId",

    # the properties below are optional
    block_device_mappings=[ec2.CfnSpotFleet.BlockDeviceMappingProperty(
        device_name="deviceName",

        # the properties below are optional
        ebs=ec2.CfnSpotFleet.EbsBlockDeviceProperty(
            delete_on_termination=False,
            encrypted=False,
            iops=123,
            snapshot_id="snapshotId",
            volume_size=123,
            volume_type="volumeType"
        ),
        no_device="noDevice",
        virtual_name="virtualName"
    )],
    ebs_optimized=False,
    iam_instance_profile=ec2.CfnSpotFleet.IamInstanceProfileSpecificationProperty(
        arn="arn"
    ),
    instance_requirements=ec2.CfnSpotFleet.InstanceRequirementsRequestProperty(
        accelerator_count=ec2.CfnSpotFleet.AcceleratorCountRequestProperty(
            max=123,
            min=123
        ),
        accelerator_manufacturers=["acceleratorManufacturers"],
        accelerator_names=["acceleratorNames"],
        accelerator_total_memory_mi_b=ec2.CfnSpotFleet.AcceleratorTotalMemoryMiBRequestProperty(
            max=123,
            min=123
        ),
        accelerator_types=["acceleratorTypes"],
        allowed_instance_types=["allowedInstanceTypes"],
        bare_metal="bareMetal",
        baseline_ebs_bandwidth_mbps=ec2.CfnSpotFleet.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.CfnSpotFleet.MemoryGiBPerVCpuRequestProperty(
            max=123,
            min=123
        ),
        memory_mi_b=ec2.CfnSpotFleet.MemoryMiBRequestProperty(
            max=123,
            min=123
        ),
        network_bandwidth_gbps=ec2.CfnSpotFleet.NetworkBandwidthGbpsRequestProperty(
            max=123,
            min=123
        ),
        network_interface_count=ec2.CfnSpotFleet.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.CfnSpotFleet.TotalLocalStorageGBRequestProperty(
            max=123,
            min=123
        ),
        v_cpu_count=ec2.CfnSpotFleet.VCpuCountRangeRequestProperty(
            max=123,
            min=123
        )
    ),
    instance_type="instanceType",
    kernel_id="kernelId",
    key_name="keyName",
    monitoring=ec2.CfnSpotFleet.SpotFleetMonitoringProperty(
        enabled=False
    ),
    network_interfaces=[ec2.CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty(
        associate_public_ip_address=False,
        delete_on_termination=False,
        description="description",
        device_index=123,
        groups=["groups"],
        ipv6_address_count=123,
        ipv6_addresses=[ec2.CfnSpotFleet.InstanceIpv6AddressProperty(
            ipv6_address="ipv6Address"
        )],
        network_interface_id="networkInterfaceId",
        private_ip_addresses=[ec2.CfnSpotFleet.PrivateIpAddressSpecificationProperty(
            private_ip_address="privateIpAddress",

            # the properties below are optional
            primary=False
        )],
        secondary_private_ip_address_count=123,
        subnet_id="subnetId"
    )],
    placement=ec2.CfnSpotFleet.SpotPlacementProperty(
        availability_zone="availabilityZone",
        group_name="groupName",
        tenancy="tenancy"
    ),
    ramdisk_id="ramdiskId",
    security_groups=[ec2.CfnSpotFleet.GroupIdentifierProperty(
        group_id="groupId"
    )],
    spot_price="spotPrice",
    subnet_id="subnetId",
    tag_specifications=[ec2.CfnSpotFleet.SpotFleetTagSpecificationProperty(
        resource_type="resourceType",
        tags=[CfnTag(
            key="key",
            value="value"
        )]
    )],
    user_data="userData",
    weighted_capacity=123
)

Attributes

block_device_mappings

One or more block devices that are mapped to the Spot Instances.

You can’t specify both a snapshot ID and an encryption value. This is because only blank volumes can be encrypted on creation. If a snapshot is the basis for a volume, it is not blank and its encryption status is used for the volume encryption status.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetlaunchspecification.html#cfn-ec2-spotfleet-spotfleetlaunchspecification-blockdevicemappings

ebs_optimized

Indicates whether the instances are optimized for EBS I/O.

This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn’t available with all instance types. Additional usage charges apply when using an EBS Optimized instance.

Default: false

Default:
  • false

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetlaunchspecification.html#cfn-ec2-spotfleet-spotfleetlaunchspecification-ebsoptimized

iam_instance_profile

The IAM instance profile.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetlaunchspecification.html#cfn-ec2-spotfleet-spotfleetlaunchspecification-iaminstanceprofile

image_id

The ID of the AMI.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetlaunchspecification.html#cfn-ec2-spotfleet-spotfleetlaunchspecification-imageid

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-spotfleet-spotfleetlaunchspecification.html#cfn-ec2-spotfleet-spotfleetlaunchspecification-instancerequirements

instance_type

The instance type.

See:

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

kernel_id

The ID of the kernel.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetlaunchspecification.html#cfn-ec2-spotfleet-spotfleetlaunchspecification-kernelid

key_name

The name of the key pair.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetlaunchspecification.html#cfn-ec2-spotfleet-spotfleetlaunchspecification-keyname

monitoring

Enable or disable monitoring for the instances.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetlaunchspecification.html#cfn-ec2-spotfleet-spotfleetlaunchspecification-monitoring

network_interfaces

The network interfaces.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetlaunchspecification.html#cfn-ec2-spotfleet-spotfleetlaunchspecification-networkinterfaces

placement

The placement information.

See:

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

ramdisk_id

The ID of the RAM disk.

Some kernels require additional drivers at launch. Check the kernel requirements for information about whether you need to specify a RAM disk. To find kernel requirements, refer to the AWS Resource Center and search for the kernel ID.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetlaunchspecification.html#cfn-ec2-spotfleet-spotfleetlaunchspecification-ramdiskid

security_groups

The security groups.

If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetlaunchspecification.html#cfn-ec2-spotfleet-spotfleetlaunchspecification-securitygroups

spot_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-spotfleet-spotfleetlaunchspecification.html#cfn-ec2-spotfleet-spotfleetlaunchspecification-spotprice

subnet_id

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

To specify multiple subnets, separate them using commas; for example, “subnet-1234abcdeexample1, subnet-0987cdef6example2”.

If you specify a network interface, you must specify any subnets as part of the network interface instead of using this parameter.

See:

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

tag_specifications

The tags to apply during creation.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetlaunchspecification.html#cfn-ec2-spotfleet-spotfleetlaunchspecification-tagspecifications

user_data

The base64-encoded user data that instances use when starting up.

User data is limited to 16 KB.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetlaunchspecification.html#cfn-ec2-spotfleet-spotfleetlaunchspecification-userdata

weighted_capacity

The number of units provided by the specified instance type.

These are the same units that you chose to set the target capacity in terms of instances, or a performance characteristic such as vCPUs, memory, or I/O.

If the target capacity divided by this value is not a whole number, Amazon EC2 rounds the number of instances to the next whole number. If this value is not specified, the default is 1. .. epigraph:

When specifying weights, the price used in the ``lowestPrice`` and ``priceCapacityOptimized`` 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-spotfleet-spotfleetlaunchspecification.html#cfn-ec2-spotfleet-spotfleetlaunchspecification-weightedcapacity

SpotFleetMonitoringProperty

class CfnSpotFleet.SpotFleetMonitoringProperty(*, enabled=None)

Bases: object

Describes whether monitoring is enabled.

Parameters:

enabled (Union[bool, IResolvable, None]) – Enables monitoring for the instance. Default: false Default: - false

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetmonitoring.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_fleet_monitoring_property = ec2.CfnSpotFleet.SpotFleetMonitoringProperty(
    enabled=False
)

Attributes

enabled

Enables monitoring for the instance.

Default: false

Default:
  • false

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetmonitoring.html#cfn-ec2-spotfleet-spotfleetmonitoring-enabled

SpotFleetRequestConfigDataProperty

class CfnSpotFleet.SpotFleetRequestConfigDataProperty(*, iam_fleet_role, target_capacity, allocation_strategy=None, context=None, excess_capacity_termination_policy=None, instance_interruption_behavior=None, instance_pools_to_use_count=None, launch_specifications=None, launch_template_configs=None, load_balancers_config=None, on_demand_allocation_strategy=None, on_demand_max_total_price=None, on_demand_target_capacity=None, replace_unhealthy_instances=None, spot_maintenance_strategies=None, spot_max_total_price=None, spot_price=None, tag_specifications=None, target_capacity_unit_type=None, terminate_instances_with_expiration=None, type=None, valid_from=None, valid_until=None)

Bases: object

Specifies the configuration of a Spot Fleet request.

For more information, see Spot Fleet in the Amazon EC2 User Guide .

You must specify either LaunchSpecifications or LaunchTemplateConfigs .

Parameters:
  • iam_fleet_role (str) – The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) role that grants the Spot Fleet the permission to request, launch, terminate, and tag instances on your behalf. For more information, see Spot Fleet Prerequisites in the Amazon EC2 User Guide . Spot Fleet can terminate Spot Instances on your behalf when you cancel its Spot Fleet request or when the Spot Fleet request expires, if you set TerminateInstancesWithExpiration .

  • target_capacity (Union[int, float]) – The number of units to request for the Spot 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.

  • allocation_strategy (Optional[str]) – The strategy that determines how to allocate the target Spot Instance capacity across the Spot Instance pools specified by the Spot Fleet launch configuration. For more information, see Allocation strategies for Spot Instances in the Amazon EC2 User Guide . - priceCapacityOptimized (recommended) - Spot Fleet identifies the pools with the highest capacity availability for the number of instances that are launching. This means that we will request Spot Instances from the pools that we believe have the lowest chance of interruption in the near term. Spot Fleet then requests Spot Instances from the lowest priced of these pools. - capacityOptimized - Spot Fleet identifies the pools with the highest capacity availability for the number of instances that are launching. This means that we will request Spot Instances from the pools that we believe have the lowest chance of interruption in the near term. To give certain instance types a higher chance of launching first, use capacityOptimizedPrioritized . Set a priority for each instance type by using the Priority parameter for LaunchTemplateOverrides . You can assign the same priority to different LaunchTemplateOverrides . EC2 implements the priorities on a best-effort basis, but optimizes for capacity first. capacityOptimizedPrioritized is supported only if your Spot Fleet uses a launch template. Note that if the OnDemandAllocationStrategy is set to prioritized , the same priority is applied when fulfilling On-Demand capacity. - diversified - Spot Fleet requests instances from all of the Spot Instance pools that you specify. - lowestPrice (not recommended) - > We don’t recommend the lowestPrice allocation strategy because it has the highest risk of interruption for your Spot Instances. Spot Fleet requests instances from the lowest priced Spot Instance pool that has available capacity. If the lowest priced pool doesn’t have available capacity, the Spot Instances come from the next lowest priced pool that has available capacity. If a pool runs out of capacity before fulfilling your desired capacity, Spot Fleet will continue to fulfill your request by drawing from the next lowest priced pool. To ensure that your desired capacity is met, you might receive Spot Instances from several pools. Because this strategy only considers instance price and not capacity availability, it might lead to high interruption rates. Default: lowestPrice

  • context (Optional[str]) – Reserved.

  • excess_capacity_termination_policy (Optional[str]) – Indicates whether running Spot Instances should be terminated if you decrease the target capacity of the Spot Fleet request below the current size of the Spot Fleet. Supported only for fleets of type maintain .

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

  • instance_pools_to_use_count (Union[int, float, None]) – The number of Spot pools across which to allocate your target Spot capacity. Valid only when Spot AllocationStrategy is set to lowest-price . Spot Fleet selects the cheapest Spot pools and evenly allocates your target Spot capacity across the number of Spot pools that you specify. Note that Spot 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, Spot 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.

  • launch_specifications (Union[IResolvable, Sequence[Union[IResolvable, SpotFleetLaunchSpecificationProperty, Dict[str, Any]]], None]) – The launch specifications for the Spot Fleet request. If you specify LaunchSpecifications , you can’t specify LaunchTemplateConfigs .

  • launch_template_configs (Union[IResolvable, Sequence[Union[IResolvable, LaunchTemplateConfigProperty, Dict[str, Any]]], None]) – The launch template and overrides. If you specify LaunchTemplateConfigs , you can’t specify LaunchSpecifications .

  • load_balancers_config (Union[IResolvable, LoadBalancersConfigProperty, Dict[str, Any], None]) – One or more Classic Load Balancers and target groups to attach to the Spot Fleet request. Spot Fleet registers the running Spot Instances with the specified Classic Load Balancers and target groups. With Network Load Balancers, Spot Fleet cannot register instances that have the following instance types: C1, CC1, CC2, CG1, CG2, CR1, CS1, G1, G2, HI1, HS1, M1, M2, M3, and T1.

  • on_demand_allocation_strategy (Optional[str]) – The order of the launch template overrides to use in fulfilling On-Demand capacity. If you specify lowestPrice , Spot Fleet uses price to determine the order, launching the lowest price first. If you specify prioritized , Spot Fleet uses the priority that you assign to each Spot Fleet launch template override, launching the highest priority first. If you do not specify a value, Spot Fleet defaults to lowestPrice .

  • on_demand_max_total_price (Optional[str]) – The maximum amount per hour for On-Demand Instances that you’re willing to pay. You can use the onDemandMaxTotalPrice parameter, the spotMaxTotalPrice parameter, or both parameters to ensure that your fleet cost does not exceed your budget. If you set a maximum price per hour for the On-Demand Instances and Spot Instances in your request, Spot Fleet will launch instances until it reaches the maximum amount you’re willing to pay. When the maximum amount you’re willing to pay is reached, the fleet stops launching instances even if it hasn’t met the target capacity. .. 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 onDemandMaxTotalPrice does not account for surplus credits, and, if you use surplus credits, your final cost might be higher than what you specified for onDemandMaxTotalPrice . For more information, see Surplus credits can incur charges in the Amazon EC2 User Guide .

  • on_demand_target_capacity (Union[int, float, None]) – The number of On-Demand units to request. 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.

  • replace_unhealthy_instances (Union[bool, IResolvable, None]) – Indicates whether Spot Fleet should replace unhealthy instances.

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

  • spot_max_total_price (Optional[str]) –

    The maximum amount per hour for Spot Instances that you’re willing to pay. You can use the spotMaxTotalPrice parameter, the onDemandMaxTotalPrice parameter, or both parameters to ensure that your fleet cost does not exceed your budget. If you set a maximum price per hour for the On-Demand Instances and Spot Instances in your request, Spot Fleet will launch instances until it reaches the maximum amount you’re willing to pay. When the maximum amount you’re willing to pay is reached, the fleet stops launching instances even if it hasn’t met the target capacity. .. 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 spotMaxTotalPrice does not account for surplus credits, and, if you use surplus credits, your final cost might be higher than what you specified for spotMaxTotalPrice . For more information, see Surplus credits can incur charges in the Amazon EC2 User Guide .

  • spot_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.

  • tag_specifications (Union[IResolvable, Sequence[Union[IResolvable, SpotFleetTagSpecificationProperty, Dict[str, Any]]], None]) – The key-value pair for tagging the Spot Fleet request on creation. The value for ResourceType must be spot-fleet-request , otherwise the Spot Fleet request fails. To tag instances at launch, specify the tags in the launch template (valid only if you use LaunchTemplateConfigs ) or in the [SpotFleetTagSpecification](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SpotFleetTagSpecification.html) (valid only if you use LaunchSpecifications ). For information about tagging after launch, see Tag your resources .

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

  • terminate_instances_with_expiration (Union[bool, IResolvable, None]) – Indicates whether running Spot Instances are terminated when the Spot Fleet request expires.

  • type (Optional[str]) – The type of request. Indicates whether the Spot Fleet only requests the target capacity or also attempts to maintain it. When this value is request , the Spot Fleet only places the required requests. It does not attempt to replenish Spot Instances if capacity is diminished, nor does it submit requests in alternative Spot pools if capacity is not available. When this value is maintain , the Spot Fleet maintains the target capacity. The Spot Fleet places the required requests to meet capacity and automatically replenishes any interrupted instances. Default: maintain . instant is listed but is not used by Spot Fleet.

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

  • valid_until (Optional[str]) – The end date and time of the request, in UTC format ( YYYY - MM - DD T HH : MM : SS Z). After the end date and time, no new Spot Instance requests are placed or able to fulfill the request. If no value is specified, the Spot Fleet request remains until you cancel it.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetrequestconfigdata.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_fleet_request_config_data_property = ec2.CfnSpotFleet.SpotFleetRequestConfigDataProperty(
    iam_fleet_role="iamFleetRole",
    target_capacity=123,

    # the properties below are optional
    allocation_strategy="allocationStrategy",
    context="context",
    excess_capacity_termination_policy="excessCapacityTerminationPolicy",
    instance_interruption_behavior="instanceInterruptionBehavior",
    instance_pools_to_use_count=123,
    launch_specifications=[ec2.CfnSpotFleet.SpotFleetLaunchSpecificationProperty(
        image_id="imageId",

        # the properties below are optional
        block_device_mappings=[ec2.CfnSpotFleet.BlockDeviceMappingProperty(
            device_name="deviceName",

            # the properties below are optional
            ebs=ec2.CfnSpotFleet.EbsBlockDeviceProperty(
                delete_on_termination=False,
                encrypted=False,
                iops=123,
                snapshot_id="snapshotId",
                volume_size=123,
                volume_type="volumeType"
            ),
            no_device="noDevice",
            virtual_name="virtualName"
        )],
        ebs_optimized=False,
        iam_instance_profile=ec2.CfnSpotFleet.IamInstanceProfileSpecificationProperty(
            arn="arn"
        ),
        instance_requirements=ec2.CfnSpotFleet.InstanceRequirementsRequestProperty(
            accelerator_count=ec2.CfnSpotFleet.AcceleratorCountRequestProperty(
                max=123,
                min=123
            ),
            accelerator_manufacturers=["acceleratorManufacturers"],
            accelerator_names=["acceleratorNames"],
            accelerator_total_memory_mi_b=ec2.CfnSpotFleet.AcceleratorTotalMemoryMiBRequestProperty(
                max=123,
                min=123
            ),
            accelerator_types=["acceleratorTypes"],
            allowed_instance_types=["allowedInstanceTypes"],
            bare_metal="bareMetal",
            baseline_ebs_bandwidth_mbps=ec2.CfnSpotFleet.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.CfnSpotFleet.MemoryGiBPerVCpuRequestProperty(
                max=123,
                min=123
            ),
            memory_mi_b=ec2.CfnSpotFleet.MemoryMiBRequestProperty(
                max=123,
                min=123
            ),
            network_bandwidth_gbps=ec2.CfnSpotFleet.NetworkBandwidthGbpsRequestProperty(
                max=123,
                min=123
            ),
            network_interface_count=ec2.CfnSpotFleet.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.CfnSpotFleet.TotalLocalStorageGBRequestProperty(
                max=123,
                min=123
            ),
            v_cpu_count=ec2.CfnSpotFleet.VCpuCountRangeRequestProperty(
                max=123,
                min=123
            )
        ),
        instance_type="instanceType",
        kernel_id="kernelId",
        key_name="keyName",
        monitoring=ec2.CfnSpotFleet.SpotFleetMonitoringProperty(
            enabled=False
        ),
        network_interfaces=[ec2.CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty(
            associate_public_ip_address=False,
            delete_on_termination=False,
            description="description",
            device_index=123,
            groups=["groups"],
            ipv6_address_count=123,
            ipv6_addresses=[ec2.CfnSpotFleet.InstanceIpv6AddressProperty(
                ipv6_address="ipv6Address"
            )],
            network_interface_id="networkInterfaceId",
            private_ip_addresses=[ec2.CfnSpotFleet.PrivateIpAddressSpecificationProperty(
                private_ip_address="privateIpAddress",

                # the properties below are optional
                primary=False
            )],
            secondary_private_ip_address_count=123,
            subnet_id="subnetId"
        )],
        placement=ec2.CfnSpotFleet.SpotPlacementProperty(
            availability_zone="availabilityZone",
            group_name="groupName",
            tenancy="tenancy"
        ),
        ramdisk_id="ramdiskId",
        security_groups=[ec2.CfnSpotFleet.GroupIdentifierProperty(
            group_id="groupId"
        )],
        spot_price="spotPrice",
        subnet_id="subnetId",
        tag_specifications=[ec2.CfnSpotFleet.SpotFleetTagSpecificationProperty(
            resource_type="resourceType",
            tags=[CfnTag(
                key="key",
                value="value"
            )]
        )],
        user_data="userData",
        weighted_capacity=123
    )],
    launch_template_configs=[ec2.CfnSpotFleet.LaunchTemplateConfigProperty(
        launch_template_specification=ec2.CfnSpotFleet.FleetLaunchTemplateSpecificationProperty(
            version="version",

            # the properties below are optional
            launch_template_id="launchTemplateId",
            launch_template_name="launchTemplateName"
        ),
        overrides=[ec2.CfnSpotFleet.LaunchTemplateOverridesProperty(
            availability_zone="availabilityZone",
            instance_requirements=ec2.CfnSpotFleet.InstanceRequirementsRequestProperty(
                accelerator_count=ec2.CfnSpotFleet.AcceleratorCountRequestProperty(
                    max=123,
                    min=123
                ),
                accelerator_manufacturers=["acceleratorManufacturers"],
                accelerator_names=["acceleratorNames"],
                accelerator_total_memory_mi_b=ec2.CfnSpotFleet.AcceleratorTotalMemoryMiBRequestProperty(
                    max=123,
                    min=123
                ),
                accelerator_types=["acceleratorTypes"],
                allowed_instance_types=["allowedInstanceTypes"],
                bare_metal="bareMetal",
                baseline_ebs_bandwidth_mbps=ec2.CfnSpotFleet.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.CfnSpotFleet.MemoryGiBPerVCpuRequestProperty(
                    max=123,
                    min=123
                ),
                memory_mi_b=ec2.CfnSpotFleet.MemoryMiBRequestProperty(
                    max=123,
                    min=123
                ),
                network_bandwidth_gbps=ec2.CfnSpotFleet.NetworkBandwidthGbpsRequestProperty(
                    max=123,
                    min=123
                ),
                network_interface_count=ec2.CfnSpotFleet.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.CfnSpotFleet.TotalLocalStorageGBRequestProperty(
                    max=123,
                    min=123
                ),
                v_cpu_count=ec2.CfnSpotFleet.VCpuCountRangeRequestProperty(
                    max=123,
                    min=123
                )
            ),
            instance_type="instanceType",
            priority=123,
            spot_price="spotPrice",
            subnet_id="subnetId",
            weighted_capacity=123
        )]
    )],
    load_balancers_config=ec2.CfnSpotFleet.LoadBalancersConfigProperty(
        classic_load_balancers_config=ec2.CfnSpotFleet.ClassicLoadBalancersConfigProperty(
            classic_load_balancers=[ec2.CfnSpotFleet.ClassicLoadBalancerProperty(
                name="name"
            )]
        ),
        target_groups_config=ec2.CfnSpotFleet.TargetGroupsConfigProperty(
            target_groups=[ec2.CfnSpotFleet.TargetGroupProperty(
                arn="arn"
            )]
        )
    ),
    on_demand_allocation_strategy="onDemandAllocationStrategy",
    on_demand_max_total_price="onDemandMaxTotalPrice",
    on_demand_target_capacity=123,
    replace_unhealthy_instances=False,
    spot_maintenance_strategies=ec2.CfnSpotFleet.SpotMaintenanceStrategiesProperty(
        capacity_rebalance=ec2.CfnSpotFleet.SpotCapacityRebalanceProperty(
            replacement_strategy="replacementStrategy",
            termination_delay=123
        )
    ),
    spot_max_total_price="spotMaxTotalPrice",
    spot_price="spotPrice",
    tag_specifications=[ec2.CfnSpotFleet.SpotFleetTagSpecificationProperty(
        resource_type="resourceType",
        tags=[CfnTag(
            key="key",
            value="value"
        )]
    )],
    target_capacity_unit_type="targetCapacityUnitType",
    terminate_instances_with_expiration=False,
    type="type",
    valid_from="validFrom",
    valid_until="validUntil"
)

Attributes

allocation_strategy

The strategy that determines how to allocate the target Spot Instance capacity across the Spot Instance pools specified by the Spot Fleet launch configuration.

For more information, see Allocation strategies for Spot Instances in the Amazon EC2 User Guide .

  • priceCapacityOptimized (recommended) - Spot Fleet identifies the pools with the highest capacity availability for the number of instances that are launching. This means that we will request Spot Instances from the pools that we believe have the lowest chance of interruption in the near term. Spot Fleet then requests Spot Instances from the lowest priced of these pools.

  • capacityOptimized - Spot Fleet identifies the pools with the highest capacity availability for the number of instances that are launching. This means that we will request Spot Instances from the pools that we believe have the lowest chance of interruption in the near term. To give certain instance types a higher chance of launching first, use capacityOptimizedPrioritized . Set a priority for each instance type by using the Priority parameter for LaunchTemplateOverrides . You can assign the same priority to different LaunchTemplateOverrides . EC2 implements the priorities on a best-effort basis, but optimizes for capacity first. capacityOptimizedPrioritized is supported only if your Spot Fleet uses a launch template. Note that if the OnDemandAllocationStrategy is set to prioritized , the same priority is applied when fulfilling On-Demand capacity.

  • diversified - Spot Fleet requests instances from all of the Spot Instance pools that you specify.

  • lowestPrice (not recommended) - > We don’t recommend the lowestPrice allocation strategy because it has the highest risk of interruption for your Spot Instances.

Spot Fleet requests instances from the lowest priced Spot Instance pool that has available capacity. If the lowest priced pool doesn’t have available capacity, the Spot Instances come from the next lowest priced pool that has available capacity. If a pool runs out of capacity before fulfilling your desired capacity, Spot Fleet will continue to fulfill your request by drawing from the next lowest priced pool. To ensure that your desired capacity is met, you might receive Spot Instances from several pools. Because this strategy only considers instance price and not capacity availability, it might lead to high interruption rates.

Default: lowestPrice

See:

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

context

Reserved.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetrequestconfigdata.html#cfn-ec2-spotfleet-spotfleetrequestconfigdata-context

excess_capacity_termination_policy

Indicates whether running Spot Instances should be terminated if you decrease the target capacity of the Spot Fleet request below the current size of the Spot Fleet.

Supported only for fleets of type maintain .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetrequestconfigdata.html#cfn-ec2-spotfleet-spotfleetrequestconfigdata-excesscapacityterminationpolicy

iam_fleet_role

The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) role that grants the Spot Fleet the permission to request, launch, terminate, and tag instances on your behalf.

For more information, see Spot Fleet Prerequisites in the Amazon EC2 User Guide . Spot Fleet can terminate Spot Instances on your behalf when you cancel its Spot Fleet request or when the Spot Fleet request expires, if you set TerminateInstancesWithExpiration .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetrequestconfigdata.html#cfn-ec2-spotfleet-spotfleetrequestconfigdata-iamfleetrole

instance_interruption_behavior

The behavior when a Spot Instance is interrupted.

The default is terminate .

See:

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

instance_pools_to_use_count

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

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

Note that Spot 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, Spot 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-spotfleet-spotfleetrequestconfigdata.html#cfn-ec2-spotfleet-spotfleetrequestconfigdata-instancepoolstousecount

launch_specifications

The launch specifications for the Spot Fleet request.

If you specify LaunchSpecifications , you can’t specify LaunchTemplateConfigs .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetrequestconfigdata.html#cfn-ec2-spotfleet-spotfleetrequestconfigdata-launchspecifications

launch_template_configs

The launch template and overrides.

If you specify LaunchTemplateConfigs , you can’t specify LaunchSpecifications .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetrequestconfigdata.html#cfn-ec2-spotfleet-spotfleetrequestconfigdata-launchtemplateconfigs

load_balancers_config

One or more Classic Load Balancers and target groups to attach to the Spot Fleet request.

Spot Fleet registers the running Spot Instances with the specified Classic Load Balancers and target groups.

With Network Load Balancers, Spot Fleet cannot register instances that have the following instance types: C1, CC1, CC2, CG1, CG2, CR1, CS1, G1, G2, HI1, HS1, M1, M2, M3, and T1.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetrequestconfigdata.html#cfn-ec2-spotfleet-spotfleetrequestconfigdata-loadbalancersconfig

on_demand_allocation_strategy

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

If you specify lowestPrice , Spot Fleet uses price to determine the order, launching the lowest price first. If you specify prioritized , Spot Fleet uses the priority that you assign to each Spot Fleet launch template override, launching the highest priority first. If you do not specify a value, Spot Fleet defaults to lowestPrice .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetrequestconfigdata.html#cfn-ec2-spotfleet-spotfleetrequestconfigdata-ondemandallocationstrategy

on_demand_max_total_price

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

You can use the onDemandMaxTotalPrice parameter, the spotMaxTotalPrice parameter, or both parameters to ensure that your fleet cost does not exceed your budget. If you set a maximum price per hour for the On-Demand Instances and Spot Instances in your request, Spot Fleet will launch instances until it reaches the maximum amount you’re willing to pay. When the maximum amount you’re willing to pay is reached, the fleet stops launching instances even if it hasn’t met the target capacity. .. 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 ``onDemandMaxTotalPrice`` does not account for surplus credits, and, if you use surplus credits, your final cost might be higher than what you specified for ``onDemandMaxTotalPrice`` . 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 *Amazon EC2 User Guide* .
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetrequestconfigdata.html#cfn-ec2-spotfleet-spotfleetrequestconfigdata-ondemandmaxtotalprice

on_demand_target_capacity

The number of On-Demand units to request.

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.

See:

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

replace_unhealthy_instances

Indicates whether Spot Fleet should replace unhealthy instances.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetrequestconfigdata.html#cfn-ec2-spotfleet-spotfleetrequestconfigdata-replaceunhealthyinstances

spot_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-spotfleet-spotfleetrequestconfigdata.html#cfn-ec2-spotfleet-spotfleetrequestconfigdata-spotmaintenancestrategies

spot_max_total_price

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

You can use the spotMaxTotalPrice parameter, the onDemandMaxTotalPrice parameter, or both parameters to ensure that your fleet cost does not exceed your budget. If you set a maximum price per hour for the On-Demand Instances and Spot Instances in your request, Spot Fleet will launch instances until it reaches the maximum amount you’re willing to pay. When the maximum amount you’re willing to pay is reached, the fleet stops launching instances even if it hasn’t met the target capacity. .. 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 ``spotMaxTotalPrice`` does not account for surplus credits, and, if you use surplus credits, your final cost might be higher than what you specified for ``spotMaxTotalPrice`` . 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 *Amazon EC2 User Guide* .
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetrequestconfigdata.html#cfn-ec2-spotfleet-spotfleetrequestconfigdata-spotmaxtotalprice

spot_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-spotfleet-spotfleetrequestconfigdata.html#cfn-ec2-spotfleet-spotfleetrequestconfigdata-spotprice

tag_specifications

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

The value for ResourceType must be spot-fleet-request , otherwise the Spot Fleet request fails. To tag instances at launch, specify the tags in the launch template (valid only if you use LaunchTemplateConfigs ) or in the [SpotFleetTagSpecification](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SpotFleetTagSpecification.html) (valid only if you use LaunchSpecifications ). For information about tagging after launch, see Tag your resources .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetrequestconfigdata.html#cfn-ec2-spotfleet-spotfleetrequestconfigdata-tagspecifications

target_capacity

The number of units to request for the Spot 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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetrequestconfigdata.html#cfn-ec2-spotfleet-spotfleetrequestconfigdata-targetcapacity

target_capacity_unit_type

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

Default: units (the number of instances)

See:

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

terminate_instances_with_expiration

Indicates whether running Spot Instances are terminated when the Spot Fleet request expires.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetrequestconfigdata.html#cfn-ec2-spotfleet-spotfleetrequestconfigdata-terminateinstanceswithexpiration

type

The type of request.

Indicates whether the Spot Fleet only requests the target capacity or also attempts to maintain it. When this value is request , the Spot Fleet only places the required requests. It does not attempt to replenish Spot Instances if capacity is diminished, nor does it submit requests in alternative Spot pools if capacity is not available. When this value is maintain , the Spot Fleet maintains the target capacity. The Spot Fleet places the required requests to meet capacity and automatically replenishes any interrupted instances. Default: maintain . instant is listed but is not used by Spot Fleet.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetrequestconfigdata.html#cfn-ec2-spotfleet-spotfleetrequestconfigdata-type

valid_from

SS Z).

By default, Amazon EC2 starts fulfilling the request immediately.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetrequestconfigdata.html#cfn-ec2-spotfleet-spotfleetrequestconfigdata-validfrom

Type:

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

Type:

MM

valid_until

SS Z).

After the end date and time, no new Spot Instance requests are placed or able to fulfill the request. If no value is specified, the Spot Fleet request remains until you cancel it.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetrequestconfigdata.html#cfn-ec2-spotfleet-spotfleetrequestconfigdata-validuntil

Type:

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

Type:

MM

SpotFleetTagSpecificationProperty

class CfnSpotFleet.SpotFleetTagSpecificationProperty(*, resource_type=None, tags=None)

Bases: object

The tags for a Spot Fleet resource.

Parameters:
  • resource_type (Optional[str]) – The type of resource. Currently, the only resource type that is supported is instance . To tag the Spot Fleet request on creation, use the TagSpecifications parameter in [SpotFleetRequestConfigData](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SpotFleetRequestConfigData.html) .

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleettagspecification.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_fleet_tag_specification_property = ec2.CfnSpotFleet.SpotFleetTagSpecificationProperty(
    resource_type="resourceType",
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)

Attributes

resource_type

The type of resource.

Currently, the only resource type that is supported is instance . To tag the Spot Fleet request on creation, use the TagSpecifications parameter in [SpotFleetRequestConfigData](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SpotFleetRequestConfigData.html) .

See:

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

tags

The tags.

See:

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

SpotMaintenanceStrategiesProperty

class CfnSpotFleet.SpotMaintenanceStrategiesProperty(*, 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, SpotCapacityRebalanceProperty, Dict[str, Any], None]) –

The Spot Instance replacement strategy to use when Amazon EC2 emits a 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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotmaintenancestrategies.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_maintenance_strategies_property = ec2.CfnSpotFleet.SpotMaintenanceStrategiesProperty(
    capacity_rebalance=ec2.CfnSpotFleet.SpotCapacityRebalanceProperty(
        replacement_strategy="replacementStrategy",
        termination_delay=123
    )
)

Attributes

capacity_rebalance

The Spot Instance replacement strategy to use when Amazon EC2 emits a 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 .

See:

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

SpotPlacementProperty

class CfnSpotFleet.SpotPlacementProperty(*, availability_zone=None, group_name=None, tenancy=None)

Bases: object

Describes Spot Instance placement.

Parameters:
  • availability_zone (Optional[str]) – The Availability Zone. To specify multiple Availability Zones, separate them using commas; for example, “us-west-2a, us-west-2b”.

  • group_name (Optional[str]) – The name of the placement group.

  • tenancy (Optional[str]) – The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware. The host tenancy is not supported for Spot Instances.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotplacement.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_placement_property = ec2.CfnSpotFleet.SpotPlacementProperty(
    availability_zone="availabilityZone",
    group_name="groupName",
    tenancy="tenancy"
)

Attributes

availability_zone

The Availability Zone.

To specify multiple Availability Zones, separate them using commas; for example, “us-west-2a, us-west-2b”.

See:

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

group_name

The name of the placement group.

See:

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

tenancy

The tenancy of the instance (if the instance is running in a VPC).

An instance with a tenancy of dedicated runs on single-tenant hardware. The host tenancy is not supported for Spot Instances.

See:

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

TargetGroupProperty

class CfnSpotFleet.TargetGroupProperty(*, arn)

Bases: object

Describes a load balancer target group.

Parameters:

arn (str) – The Amazon Resource Name (ARN) of the target group.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-targetgroup.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_group_property = ec2.CfnSpotFleet.TargetGroupProperty(
    arn="arn"
)

Attributes

arn

The Amazon Resource Name (ARN) of the target group.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-targetgroup.html#cfn-ec2-spotfleet-targetgroup-arn

TargetGroupsConfigProperty

class CfnSpotFleet.TargetGroupsConfigProperty(*, target_groups)

Bases: object

Describes the target groups to attach to a Spot Fleet.

Spot Fleet registers the running Spot Instances with these target groups.

Parameters:

target_groups (Union[IResolvable, Sequence[Union[IResolvable, TargetGroupProperty, Dict[str, Any]]]]) – One or more target groups.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-targetgroupsconfig.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_groups_config_property = ec2.CfnSpotFleet.TargetGroupsConfigProperty(
    target_groups=[ec2.CfnSpotFleet.TargetGroupProperty(
        arn="arn"
    )]
)

Attributes

target_groups

One or more target groups.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-targetgroupsconfig.html#cfn-ec2-spotfleet-targetgroupsconfig-targetgroups

TotalLocalStorageGBRequestProperty

class CfnSpotFleet.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-spotfleet-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.CfnSpotFleet.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-spotfleet-totallocalstoragegbrequest.html#cfn-ec2-spotfleet-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-spotfleet-totallocalstoragegbrequest.html#cfn-ec2-spotfleet-totallocalstoragegbrequest-min

VCpuCountRangeRequestProperty

class CfnSpotFleet.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-spotfleet-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.CfnSpotFleet.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-spotfleet-vcpucountrangerequest.html#cfn-ec2-spotfleet-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-spotfleet-vcpucountrangerequest.html#cfn-ec2-spotfleet-vcpucountrangerequest-min