CfnEC2FleetProps

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

Bases: object

Properties for defining a AWS::EC2::EC2Fleet.

Parameters
Link

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

Example:

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

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

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

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

Attributes

context

AWS::EC2::EC2Fleet.Context.

Link

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

Return type

Optional[str]

excess_capacity_termination_policy

AWS::EC2::EC2Fleet.ExcessCapacityTerminationPolicy.

Link

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

Return type

Optional[str]

launch_template_configs

AWS::EC2::EC2Fleet.LaunchTemplateConfigs.

Link

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

Return type

Union[IResolvable, List[Union[IResolvable, FleetLaunchTemplateConfigRequestProperty]]]

on_demand_options

AWS::EC2::EC2Fleet.OnDemandOptions.

Link

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

Return type

Union[IResolvable, OnDemandOptionsRequestProperty, None]

replace_unhealthy_instances

AWS::EC2::EC2Fleet.ReplaceUnhealthyInstances.

Link

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

Return type

Union[bool, IResolvable, None]

spot_options

AWS::EC2::EC2Fleet.SpotOptions.

Link

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

Return type

Union[IResolvable, SpotOptionsRequestProperty, None]

tag_specifications

AWS::EC2::EC2Fleet.TagSpecifications.

Link

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

Return type

Union[IResolvable, List[Union[IResolvable, TagSpecificationProperty]], None]

target_capacity_specification

AWS::EC2::EC2Fleet.TargetCapacitySpecification.

Link

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

Return type

Union[IResolvable, TargetCapacitySpecificationRequestProperty]

terminate_instances_with_expiration

AWS::EC2::EC2Fleet.TerminateInstancesWithExpiration.

Link

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

Return type

Union[bool, IResolvable, None]

type

AWS::EC2::EC2Fleet.Type.

Link

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

Return type

Optional[str]

valid_from

AWS::EC2::EC2Fleet.ValidFrom.

Link

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

Return type

Optional[str]

valid_until

AWS::EC2::EC2Fleet.ValidUntil.

Link

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

Return type

Optional[str]