CfnCapacityProvider
- class aws_cdk.aws_ecs.CfnCapacityProvider(scope, id, *, auto_scaling_group_provider=None, cluster_name=None, managed_instances_provider=None, name=None, tags=None)
Bases:
CfnResourceCreates a capacity provider.
Capacity providers are associated with a cluster and are used in capacity provider strategies to facilitate cluster auto scaling. You can create capacity providers for Amazon ECS Managed Instances and EC2 instances. AWS Fargate has the predefined
FARGATEandFARGATE_SPOTcapacity providers.- See:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-capacityprovider.html
- CloudformationResource:
AWS::ECS::CapacityProvider
- 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_ecs as ecs cfn_capacity_provider = ecs.CfnCapacityProvider(self, "MyCfnCapacityProvider", auto_scaling_group_provider=ecs.CfnCapacityProvider.AutoScalingGroupProviderProperty( auto_scaling_group_arn="autoScalingGroupArn", # the properties below are optional managed_draining="managedDraining", managed_scaling=ecs.CfnCapacityProvider.ManagedScalingProperty( instance_warmup_period=123, maximum_scaling_step_size=123, minimum_scaling_step_size=123, status="status", target_capacity=123 ), managed_termination_protection="managedTerminationProtection" ), cluster_name="clusterName", managed_instances_provider=ecs.CfnCapacityProvider.ManagedInstancesProviderProperty( infrastructure_role_arn="infrastructureRoleArn", instance_launch_template=ecs.CfnCapacityProvider.InstanceLaunchTemplateProperty( ec2_instance_profile_arn="ec2InstanceProfileArn", network_configuration=ecs.CfnCapacityProvider.ManagedInstancesNetworkConfigurationProperty( subnets=["subnets"], # the properties below are optional security_groups=["securityGroups"] ), # the properties below are optional instance_requirements=ecs.CfnCapacityProvider.InstanceRequirementsRequestProperty( memory_mi_b=ecs.CfnCapacityProvider.MemoryMiBRequestProperty( min=123, # the properties below are optional max=123 ), v_cpu_count=ecs.CfnCapacityProvider.VCpuCountRangeRequestProperty( min=123, # the properties below are optional max=123 ), # the properties below are optional accelerator_count=ecs.CfnCapacityProvider.AcceleratorCountRequestProperty( max=123, min=123 ), accelerator_manufacturers=["acceleratorManufacturers"], accelerator_names=["acceleratorNames"], accelerator_total_memory_mi_b=ecs.CfnCapacityProvider.AcceleratorTotalMemoryMiBRequestProperty( max=123, min=123 ), accelerator_types=["acceleratorTypes"], allowed_instance_types=["allowedInstanceTypes"], bare_metal="bareMetal", baseline_ebs_bandwidth_mbps=ecs.CfnCapacityProvider.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=ecs.CfnCapacityProvider.MemoryGiBPerVCpuRequestProperty( max=123, min=123 ), network_bandwidth_gbps=ecs.CfnCapacityProvider.NetworkBandwidthGbpsRequestProperty( max=123, min=123 ), network_interface_count=ecs.CfnCapacityProvider.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=ecs.CfnCapacityProvider.TotalLocalStorageGBRequestProperty( max=123, min=123 ) ), monitoring="monitoring", storage_configuration=ecs.CfnCapacityProvider.ManagedInstancesStorageConfigurationProperty( storage_size_gi_b=123 ) ), # the properties below are optional propagate_tags="propagateTags" ), name="name", tags=[CfnTag( key="key", value="value" )] )
- Parameters:
scope (
Construct) – Scope in which this resource is defined.id (
str) – Construct identifier for this resource (unique in its scope).auto_scaling_group_provider (
Union[IResolvable,AutoScalingGroupProviderProperty,Dict[str,Any],None]) – The Auto Scaling group settings for the capacity provider.cluster_name (
Optional[str]) – The cluster that this capacity provider is associated with. Managed instances capacity providers are cluster-scoped, meaning they can only be used within their associated cluster. This is required for Managed instances.managed_instances_provider (
Union[IResolvable,ManagedInstancesProviderProperty,Dict[str,Any],None]) – The configuration for the Amazon ECS Managed Instances provider. This includes the infrastructure role, the launch template configuration, and tag propagation settings.name (
Optional[str]) – The name of the capacity provider. If a name is specified, it cannot start withaws,ecs, orfargate. If no name is specified, a default name in theCFNStackName-CFNResourceName-RandomStringformat is used.tags (
Optional[Sequence[Union[CfnTag,Dict[str,Any]]]]) – The metadata that you apply to the capacity provider to help you categorize and organize it. Each tag consists of a key and an optional value. You define both. The following basic restrictions apply to tags: - Maximum number of tags per resource - 50 - For each resource, each tag key must be unique, and each tag key can have only one value. - Maximum key length - 128 Unicode characters in UTF-8 - Maximum value length - 256 Unicode characters in UTF-8 - If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : /
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
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
addPropertyOverrideor prefixpathwith “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
valueargument toaddOverridewill 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: truedefault (
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:
- 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:
- get_metadata(key)
Retrieve a value value from the CloudFormation Resource Metadata.
- Parameters:
key (
str)- See:
- Return type:
Any
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:
target (
CfnResource) – The dependency to replace.new_target (
CfnResource) – The new dependency to add.
- 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::ECS::CapacityProvider'
- auto_scaling_group_provider
The Auto Scaling group settings for the capacity provider.
- capacity_provider_ref
A reference to a CapacityProvider resource.
- cfn_options
Options for this resource, such as condition, update policy etc.
- cfn_resource_type
AWS resource type.
- cluster_name
The cluster that this capacity provider is associated with.
- 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.
- managed_instances_provider
The configuration for the Amazon ECS Managed Instances provider.
- name
The name of the capacity provider.
- 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 }).
- stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
- tags
Tag Manager which manages the tags for this resource.
- tags_raw
The metadata that you apply to the capacity provider to help you categorize and organize it.
Static Methods
- classmethod from_capacity_provider_name(scope, id, capacity_provider_name)
Creates a new ICapacityProviderRef from a capacityProviderName.
- Parameters:
scope (
Construct)id (
str)capacity_provider_name (
str)
- Return type:
- classmethod is_cfn_element(x)
Returns
trueif a construct is a stack element (i.e. part of the synthesized cloudformation template).Uses duck-typing instead of
instanceofto 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
xis a construct.Use this method instead of
instanceofto properly detectConstructinstances, even when the construct library is symlinked.Explanation: in JavaScript, multiple copies of the
constructslibrary on disk are seen as independent, completely different libraries. As a consequence, the classConstructin each copy of theconstructslibrary is seen as a different class, and an instance of one class will not test asinstanceofthe other class.npm installwill not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of theconstructslibrary can be accidentally installed, andinstanceofwill behave unpredictably. It is safest to avoid usinginstanceof, and using this type-testing method instead.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsConstruct.
AcceleratorCountRequestProperty
- class CfnCapacityProvider.AcceleratorCountRequestProperty(*, max=None, min=None)
Bases:
objectThe minimum and maximum number of accelerators (such as GPUs) for instance type selection.
This is used for workloads that require specific numbers of accelerators.
- Parameters:
max (
Union[int,float,None]) – The maximum number of accelerators. Instance types with more accelerators are excluded from selection.min (
Union[int,float,None]) – The minimum number of accelerators. Instance types with fewer accelerators are excluded from selection.
- See:
- 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_ecs as ecs accelerator_count_request_property = ecs.CfnCapacityProvider.AcceleratorCountRequestProperty( max=123, min=123 )
Attributes
- max
The maximum number of accelerators.
Instance types with more accelerators are excluded from selection.
- min
The minimum number of accelerators.
Instance types with fewer accelerators are excluded from selection.
AcceleratorTotalMemoryMiBRequestProperty
- class CfnCapacityProvider.AcceleratorTotalMemoryMiBRequestProperty(*, max=None, min=None)
Bases:
objectThe minimum and maximum total accelerator memory in mebibytes (MiB) for instance type selection.
This is important for GPU workloads that require specific amounts of video memory.
- Parameters:
max (
Union[int,float,None]) – The maximum total accelerator memory in MiB. Instance types with more accelerator memory are excluded from selection.min (
Union[int,float,None]) – The minimum total accelerator memory in MiB. Instance types with less accelerator memory are excluded from selection.
- See:
- 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_ecs as ecs accelerator_total_memory_mi_bRequest_property = ecs.CfnCapacityProvider.AcceleratorTotalMemoryMiBRequestProperty( max=123, min=123 )
Attributes
- max
The maximum total accelerator memory in MiB.
Instance types with more accelerator memory are excluded from selection.
- min
The minimum total accelerator memory in MiB.
Instance types with less accelerator memory are excluded from selection.
AutoScalingGroupProviderProperty
- class CfnCapacityProvider.AutoScalingGroupProviderProperty(*, auto_scaling_group_arn, managed_draining=None, managed_scaling=None, managed_termination_protection=None)
Bases:
objectThe details of the Auto Scaling group for the capacity provider.
- Parameters:
auto_scaling_group_arn (
str) – The Amazon Resource Name (ARN) that identifies the Auto Scaling group, or the Auto Scaling group name.managed_draining (
Optional[str]) – The managed draining option for the Auto Scaling group capacity provider. When you enable this, Amazon ECS manages and gracefully drains the EC2 container instances that are in the Auto Scaling group capacity provider.managed_scaling (
Union[IResolvable,ManagedScalingProperty,Dict[str,Any],None]) – The managed scaling settings for the Auto Scaling group capacity provider.managed_termination_protection (
Optional[str]) – The managed termination protection setting to use for the Auto Scaling group capacity provider. This determines whether the Auto Scaling group has managed termination protection. The default is off. .. epigraph:: When using managed termination protection, managed scaling must also be used otherwise managed termination protection doesn’t work. When managed termination protection is on, Amazon ECS prevents the Amazon EC2 instances in an Auto Scaling group that contain tasks from being terminated during a scale-in action. The Auto Scaling group and each instance in the Auto Scaling group must have instance protection from scale-in actions on as well. For more information, see Instance Protection in the AWS Auto Scaling User Guide . When managed termination protection is off, your Amazon EC2 instances aren’t protected from termination when the Auto Scaling group scales in.
- See:
- 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_ecs as ecs auto_scaling_group_provider_property = ecs.CfnCapacityProvider.AutoScalingGroupProviderProperty( auto_scaling_group_arn="autoScalingGroupArn", # the properties below are optional managed_draining="managedDraining", managed_scaling=ecs.CfnCapacityProvider.ManagedScalingProperty( instance_warmup_period=123, maximum_scaling_step_size=123, minimum_scaling_step_size=123, status="status", target_capacity=123 ), managed_termination_protection="managedTerminationProtection" )
Attributes
- auto_scaling_group_arn
The Amazon Resource Name (ARN) that identifies the Auto Scaling group, or the Auto Scaling group name.
- managed_draining
The managed draining option for the Auto Scaling group capacity provider.
When you enable this, Amazon ECS manages and gracefully drains the EC2 container instances that are in the Auto Scaling group capacity provider.
- managed_scaling
The managed scaling settings for the Auto Scaling group capacity provider.
- managed_termination_protection
The managed termination protection setting to use for the Auto Scaling group capacity provider.
This determines whether the Auto Scaling group has managed termination protection. The default is off. .. epigraph:
When using managed termination protection, managed scaling must also be used otherwise managed termination protection doesn't work.
When managed termination protection is on, Amazon ECS prevents the Amazon EC2 instances in an Auto Scaling group that contain tasks from being terminated during a scale-in action. The Auto Scaling group and each instance in the Auto Scaling group must have instance protection from scale-in actions on as well. For more information, see Instance Protection in the AWS Auto Scaling User Guide .
When managed termination protection is off, your Amazon EC2 instances aren’t protected from termination when the Auto Scaling group scales in.
BaselineEbsBandwidthMbpsRequestProperty
- class CfnCapacityProvider.BaselineEbsBandwidthMbpsRequestProperty(*, max=None, min=None)
Bases:
objectThe minimum and maximum baseline Amazon EBS bandwidth in megabits per second (Mbps) for instance type selection.
This is important for workloads with high storage I/O requirements.
- Parameters:
max (
Union[int,float,None]) – The maximum baseline Amazon EBS bandwidth in Mbps. Instance types with higher Amazon EBS bandwidth are excluded from selection.min (
Union[int,float,None]) – The minimum baseline Amazon EBS bandwidth in Mbps. Instance types with lower Amazon EBS bandwidth are excluded from selection.
- See:
- 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_ecs as ecs baseline_ebs_bandwidth_mbps_request_property = ecs.CfnCapacityProvider.BaselineEbsBandwidthMbpsRequestProperty( max=123, min=123 )
Attributes
- max
The maximum baseline Amazon EBS bandwidth in Mbps.
Instance types with higher Amazon EBS bandwidth are excluded from selection.
- min
The minimum baseline Amazon EBS bandwidth in Mbps.
Instance types with lower Amazon EBS bandwidth are excluded from selection.
InstanceLaunchTemplateProperty
- class CfnCapacityProvider.InstanceLaunchTemplateProperty(*, ec2_instance_profile_arn, network_configuration, instance_requirements=None, monitoring=None, storage_configuration=None)
Bases:
objectThe launch template configuration for Amazon ECS Managed Instances.
This defines how Amazon ECS launches Amazon EC2 instances, including the instance profile for your tasks, network and storage configuration, capacity options, and instance requirements for flexible instance type selection.
- Parameters:
ec2_instance_profile_arn (
str) – The Amazon Resource Name (ARN) of the instance profile that Amazon ECS applies to Amazon ECS Managed Instances. This instance profile must include the necessary permissions for your tasks to access AWS services and resources. For more information, see Amazon ECS instance profile for Managed Instances in the Amazon ECS Developer Guide .network_configuration (
Union[IResolvable,ManagedInstancesNetworkConfigurationProperty,Dict[str,Any]]) – The network configuration for Amazon ECS Managed Instances. This specifies the subnets and security groups that instances use for network connectivity.instance_requirements (
Union[IResolvable,InstanceRequirementsRequestProperty,Dict[str,Any],None]) – The instance requirements. You can specify:. - The instance types - Instance requirements such as vCPU count, memory, network performance, and accelerator specifications Amazon ECS automatically selects the instances that match the specified criteria.monitoring (
Optional[str]) – CloudWatch provides two categories of monitoring: basic monitoring and detailed monitoring. By default, your managed instance is configured for basic monitoring. You can optionally enable detailed monitoring to help you more quickly identify and act on operational issues. You can enable or turn off detailed monitoring at launch or when the managed instance is running or stopped. For more information, see Detailed monitoring for Amazon ECS Managed Instances in the Amazon ECS Developer Guide.storage_configuration (
Union[IResolvable,ManagedInstancesStorageConfigurationProperty,Dict[str,Any],None]) – The storage configuration for Amazon ECS Managed Instances. This defines the root volume size and type for the instances.
- See:
- 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_ecs as ecs instance_launch_template_property = ecs.CfnCapacityProvider.InstanceLaunchTemplateProperty( ec2_instance_profile_arn="ec2InstanceProfileArn", network_configuration=ecs.CfnCapacityProvider.ManagedInstancesNetworkConfigurationProperty( subnets=["subnets"], # the properties below are optional security_groups=["securityGroups"] ), # the properties below are optional instance_requirements=ecs.CfnCapacityProvider.InstanceRequirementsRequestProperty( memory_mi_b=ecs.CfnCapacityProvider.MemoryMiBRequestProperty( min=123, # the properties below are optional max=123 ), v_cpu_count=ecs.CfnCapacityProvider.VCpuCountRangeRequestProperty( min=123, # the properties below are optional max=123 ), # the properties below are optional accelerator_count=ecs.CfnCapacityProvider.AcceleratorCountRequestProperty( max=123, min=123 ), accelerator_manufacturers=["acceleratorManufacturers"], accelerator_names=["acceleratorNames"], accelerator_total_memory_mi_b=ecs.CfnCapacityProvider.AcceleratorTotalMemoryMiBRequestProperty( max=123, min=123 ), accelerator_types=["acceleratorTypes"], allowed_instance_types=["allowedInstanceTypes"], bare_metal="bareMetal", baseline_ebs_bandwidth_mbps=ecs.CfnCapacityProvider.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=ecs.CfnCapacityProvider.MemoryGiBPerVCpuRequestProperty( max=123, min=123 ), network_bandwidth_gbps=ecs.CfnCapacityProvider.NetworkBandwidthGbpsRequestProperty( max=123, min=123 ), network_interface_count=ecs.CfnCapacityProvider.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=ecs.CfnCapacityProvider.TotalLocalStorageGBRequestProperty( max=123, min=123 ) ), monitoring="monitoring", storage_configuration=ecs.CfnCapacityProvider.ManagedInstancesStorageConfigurationProperty( storage_size_gi_b=123 ) )
Attributes
- ec2_instance_profile_arn
The Amazon Resource Name (ARN) of the instance profile that Amazon ECS applies to Amazon ECS Managed Instances.
This instance profile must include the necessary permissions for your tasks to access AWS services and resources.
For more information, see Amazon ECS instance profile for Managed Instances in the Amazon ECS Developer Guide .
- instance_requirements
.
The instance types
Instance requirements such as vCPU count, memory, network performance, and accelerator specifications
Amazon ECS automatically selects the instances that match the specified criteria.
- See:
- Type:
The instance requirements. You can specify
- monitoring
basic monitoring and detailed monitoring.
By default, your managed instance is configured for basic monitoring. You can optionally enable detailed monitoring to help you more quickly identify and act on operational issues. You can enable or turn off detailed monitoring at launch or when the managed instance is running or stopped. For more information, see Detailed monitoring for Amazon ECS Managed Instances in the Amazon ECS Developer Guide.
- See:
- Type:
CloudWatch provides two categories of monitoring
- network_configuration
The network configuration for Amazon ECS Managed Instances.
This specifies the subnets and security groups that instances use for network connectivity.
- storage_configuration
The storage configuration for Amazon ECS Managed Instances.
This defines the root volume size and type for the instances.
InstanceRequirementsRequestProperty
- class CfnCapacityProvider.InstanceRequirementsRequestProperty(*, memory_mib, v_cpu_count, 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, 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)
Bases:
objectThe instance requirements for attribute-based instance type selection.
Instead of specifying exact instance types, you define requirements such as vCPU count, memory size, network performance, and accelerator specifications. Amazon ECS automatically selects Amazon EC2 instance types that match these requirements, providing flexibility and helping to mitigate capacity constraints.
- Parameters:
memory_mib (
Union[IResolvable,MemoryMiBRequestProperty,Dict[str,Any]]) – The minimum and maximum amount of memory in mebibytes (MiB) for the instance types. Amazon ECS selects instance types that have memory within this range.v_cpu_count (
Union[IResolvable,VCpuCountRangeRequestProperty,Dict[str,Any]]) – The minimum and maximum number of vCPUs for the instance types. Amazon ECS selects instance types that have vCPU counts within this range.accelerator_count (
Union[IResolvable,AcceleratorCountRequestProperty,Dict[str,Any],None]) – The minimum and maximum number of accelerators for the instance types. This is used when you need instances with specific numbers of GPUs or other accelerators.accelerator_manufacturers (
Optional[Sequence[str]]) – The accelerator manufacturers to include. You can specifynvidia,amd,amazon-web-services, orxilinxdepending on your accelerator requirements.accelerator_names (
Optional[Sequence[str]]) – The specific accelerator names to include. For example, you can specifya100,v100,k80, or other specific accelerator models.accelerator_total_memory_mib (
Union[IResolvable,AcceleratorTotalMemoryMiBRequestProperty,Dict[str,Any],None]) – The minimum and maximum total accelerator memory in mebibytes (MiB). This is important for GPU workloads that require specific amounts of video memory.accelerator_types (
Optional[Sequence[str]]) – The accelerator types to include. You can specifygpufor graphics processing units,fpgafor field programmable gate arrays, orinferencefor machine learning inference accelerators.allowed_instance_types (
Optional[Sequence[str]]) – The instance types to include in the selection. When specified, Amazon ECS only considers these instance types, subject to the other requirements specified.bare_metal (
Optional[str]) – Indicates whether to include bare metal instance types. Set toincludedto allow bare metal instances,excludedto exclude them, orrequiredto use only bare metal instances.baseline_ebs_bandwidth_mbps (
Union[IResolvable,BaselineEbsBandwidthMbpsRequestProperty,Dict[str,Any],None]) – The minimum and maximum baseline Amazon EBS bandwidth in megabits per second (Mbps). This is important for workloads with high storage I/O requirements.burstable_performance (
Optional[str]) – Indicates whether to include burstable performance instance types (T2, T3, T3a, T4g). Set toincludedto allow burstable instances,excludedto exclude them, orrequiredto use only burstable instances.cpu_manufacturers (
Optional[Sequence[str]]) – The CPU manufacturers to include or exclude. You can specifyintel,amd, oramazon-web-servicesto control which CPU types are used for your workloads.excluded_instance_types (
Optional[Sequence[str]]) – The instance types to exclude from selection. Use this to prevent Amazon ECS from selecting specific instance types that may not be suitable for your workloads.instance_generations (
Optional[Sequence[str]]) – The instance generations to include. You can specifycurrentto use the latest generation instances, orpreviousto include previous generation instances for cost optimization.local_storage (
Optional[str]) – Indicates whether to include instance types with local storage. Set toincludedto allow local storage,excludedto exclude it, orrequiredto use only instances with local storage.local_storage_types (
Optional[Sequence[str]]) – The local storage types to include. You can specifyhddfor hard disk drives,ssdfor solid state drives, or both.max_spot_price_as_percentage_of_optimal_on_demand_price (
Union[int,float,None]) – The maximum price for Spot instances as a percentage of the optimal On-Demand price. This provides more precise cost control for Spot instance selection.memory_gib_per_v_cpu (
Union[IResolvable,MemoryGiBPerVCpuRequestProperty,Dict[str,Any],None]) – The minimum and maximum amount of memory per vCPU in gibibytes (GiB). This helps ensure that instance types have the appropriate memory-to-CPU ratio for your workloads.network_bandwidth_gbps (
Union[IResolvable,NetworkBandwidthGbpsRequestProperty,Dict[str,Any],None]) – The minimum and maximum network bandwidth in gigabits per second (Gbps). This is crucial for network-intensive workloads that require high throughput.network_interface_count (
Union[IResolvable,NetworkInterfaceCountRequestProperty,Dict[str,Any],None]) – The minimum and maximum number of network interfaces for the instance types. This is useful for workloads that require multiple network interfaces.on_demand_max_price_percentage_over_lowest_price (
Union[int,float,None]) – 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. If no current generation C, M, or R instance type matches your attributes, then the identified price is from either the lowest priced current generation instance types or, failing that, the lowest priced previous generation instance types that match your attributes. When Amazon ECS selects instance types with your attributes, we will exclude instance types whose price exceeds your specified threshold.require_hibernate_support (
Union[bool,IResolvable,None]) – Indicates whether the instance types must support hibernation. When set totrue, only instance types that support hibernation are selected.spot_max_price_percentage_over_lowest_price (
Union[int,float,None]) – The maximum price for Spot instances as a percentage over the lowest priced On-Demand instance. This helps control Spot instance costs while maintaining access to capacity.total_local_storage_gb (
Union[IResolvable,TotalLocalStorageGBRequestProperty,Dict[str,Any],None]) – The minimum and maximum total local storage in gigabytes (GB) for instance types with local storage.
- See:
- 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_ecs as ecs instance_requirements_request_property = ecs.CfnCapacityProvider.InstanceRequirementsRequestProperty( memory_mi_b=ecs.CfnCapacityProvider.MemoryMiBRequestProperty( min=123, # the properties below are optional max=123 ), v_cpu_count=ecs.CfnCapacityProvider.VCpuCountRangeRequestProperty( min=123, # the properties below are optional max=123 ), # the properties below are optional accelerator_count=ecs.CfnCapacityProvider.AcceleratorCountRequestProperty( max=123, min=123 ), accelerator_manufacturers=["acceleratorManufacturers"], accelerator_names=["acceleratorNames"], accelerator_total_memory_mi_b=ecs.CfnCapacityProvider.AcceleratorTotalMemoryMiBRequestProperty( max=123, min=123 ), accelerator_types=["acceleratorTypes"], allowed_instance_types=["allowedInstanceTypes"], bare_metal="bareMetal", baseline_ebs_bandwidth_mbps=ecs.CfnCapacityProvider.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=ecs.CfnCapacityProvider.MemoryGiBPerVCpuRequestProperty( max=123, min=123 ), network_bandwidth_gbps=ecs.CfnCapacityProvider.NetworkBandwidthGbpsRequestProperty( max=123, min=123 ), network_interface_count=ecs.CfnCapacityProvider.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=ecs.CfnCapacityProvider.TotalLocalStorageGBRequestProperty( max=123, min=123 ) )
Attributes
- accelerator_count
The minimum and maximum number of accelerators for the instance types.
This is used when you need instances with specific numbers of GPUs or other accelerators.
- accelerator_manufacturers
The accelerator manufacturers to include.
You can specify
nvidia,amd,amazon-web-services, orxilinxdepending on your accelerator requirements.
- accelerator_names
The specific accelerator names to include.
For example, you can specify
a100,v100,k80, or other specific accelerator models.
- accelerator_total_memory_mib
The minimum and maximum total accelerator memory in mebibytes (MiB).
This is important for GPU workloads that require specific amounts of video memory.
- accelerator_types
The accelerator types to include.
You can specify
gpufor graphics processing units,fpgafor field programmable gate arrays, orinferencefor machine learning inference accelerators.
- allowed_instance_types
The instance types to include in the selection.
When specified, Amazon ECS only considers these instance types, subject to the other requirements specified.
- bare_metal
Indicates whether to include bare metal instance types.
Set to
includedto allow bare metal instances,excludedto exclude them, orrequiredto use only bare metal instances.
- baseline_ebs_bandwidth_mbps
The minimum and maximum baseline Amazon EBS bandwidth in megabits per second (Mbps).
This is important for workloads with high storage I/O requirements.
- burstable_performance
Indicates whether to include burstable performance instance types (T2, T3, T3a, T4g).
Set to
includedto allow burstable instances,excludedto exclude them, orrequiredto use only burstable instances.
- cpu_manufacturers
The CPU manufacturers to include or exclude.
You can specify
intel,amd, oramazon-web-servicesto control which CPU types are used for your workloads.
- excluded_instance_types
The instance types to exclude from selection.
Use this to prevent Amazon ECS from selecting specific instance types that may not be suitable for your workloads.
- instance_generations
The instance generations to include.
You can specify
currentto use the latest generation instances, orpreviousto include previous generation instances for cost optimization.
- local_storage
Indicates whether to include instance types with local storage.
Set to
includedto allow local storage,excludedto exclude it, orrequiredto use only instances with local storage.
- local_storage_types
The local storage types to include.
You can specify
hddfor hard disk drives,ssdfor solid state drives, or both.
- max_spot_price_as_percentage_of_optimal_on_demand_price
The maximum price for Spot instances as a percentage of the optimal On-Demand price.
This provides more precise cost control for Spot instance selection.
- memory_gib_per_v_cpu
The minimum and maximum amount of memory per vCPU in gibibytes (GiB).
This helps ensure that instance types have the appropriate memory-to-CPU ratio for your workloads.
- memory_mib
The minimum and maximum amount of memory in mebibytes (MiB) for the instance types.
Amazon ECS selects instance types that have memory within this range.
- network_bandwidth_gbps
The minimum and maximum network bandwidth in gigabits per second (Gbps).
This is crucial for network-intensive workloads that require high throughput.
- network_interface_count
The minimum and maximum number of network interfaces for the instance types.
This is useful for workloads that require multiple network interfaces.
- on_demand_max_price_percentage_over_lowest_price
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. If no current generation C, M, or R instance type matches your attributes, then the identified price is from either the lowest priced current generation instance types or, failing that, the lowest priced previous generation instance types that match your attributes. When Amazon ECS selects instance types with your attributes, we will exclude instance types whose price exceeds your specified threshold.
- require_hibernate_support
Indicates whether the instance types must support hibernation.
When set to
true, only instance types that support hibernation are selected.
- spot_max_price_percentage_over_lowest_price
The maximum price for Spot instances as a percentage over the lowest priced On-Demand instance.
This helps control Spot instance costs while maintaining access to capacity.
- total_local_storage_gb
The minimum and maximum total local storage in gigabytes (GB) for instance types with local storage.
- v_cpu_count
The minimum and maximum number of vCPUs for the instance types.
Amazon ECS selects instance types that have vCPU counts within this range.
ManagedInstancesNetworkConfigurationProperty
- class CfnCapacityProvider.ManagedInstancesNetworkConfigurationProperty(*, subnets, security_groups=None)
Bases:
objectThe network configuration for Amazon ECS Managed Instances.
This specifies the VPC subnets and security groups that instances use for network connectivity. Amazon ECS Managed Instances support multiple network modes including
awsvpc(instances receive ENIs for task isolation),host(instances share network namespace with tasks), andnone(no external network connectivity), ensuring backward compatibility for migrating workloads from Fargate or Amazon EC2.- Parameters:
subnets (
Sequence[str]) – The list of subnet IDs where Amazon ECS can launch Amazon ECS Managed Instances. Instances are distributed across the specified subnets for high availability. All subnets must be in the same VPC.security_groups (
Optional[Sequence[str]]) – The list of security group IDs to apply to Amazon ECS Managed Instances. These security groups control the network traffic allowed to and from the instances.
- See:
- 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_ecs as ecs managed_instances_network_configuration_property = ecs.CfnCapacityProvider.ManagedInstancesNetworkConfigurationProperty( subnets=["subnets"], # the properties below are optional security_groups=["securityGroups"] )
Attributes
- security_groups
The list of security group IDs to apply to Amazon ECS Managed Instances.
These security groups control the network traffic allowed to and from the instances.
- subnets
The list of subnet IDs where Amazon ECS can launch Amazon ECS Managed Instances.
Instances are distributed across the specified subnets for high availability. All subnets must be in the same VPC.
ManagedInstancesProviderProperty
- class CfnCapacityProvider.ManagedInstancesProviderProperty(*, infrastructure_role_arn, instance_launch_template, propagate_tags=None)
Bases:
objectThe configuration for a Amazon ECS Managed Instances provider.
Amazon ECS uses this configuration to automatically launch, manage, and terminate Amazon EC2 instances on your behalf. Managed instances provide access to the full range of Amazon EC2 instance types and features while offloading infrastructure management to AWS .
- Parameters:
infrastructure_role_arn (
str) – The Amazon Resource Name (ARN) of the infrastructure role that Amazon ECS assumes to manage instances. This role must include permissions for Amazon EC2 instance lifecycle management, networking, and any additional AWS services required for your workloads. For more information, see Amazon ECS infrastructure IAM role in the Amazon ECS Developer Guide .instance_launch_template (
Union[IResolvable,InstanceLaunchTemplateProperty,Dict[str,Any]]) – The launch template that defines how Amazon ECS launches Amazon ECS Managed Instances. This includes the instance profile for your tasks, network and storage configuration, and instance requirements that determine which Amazon EC2 instance types can be used. For more information, see Store instance launch parameters in Amazon EC2 launch templates in the Amazon EC2 User Guide .propagate_tags (
Optional[str]) – Determines whether tags from the capacity provider are automatically applied to Amazon ECS Managed Instances. This helps with cost allocation and resource management by ensuring consistent tagging across your infrastructure.
- See:
- 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_ecs as ecs managed_instances_provider_property = ecs.CfnCapacityProvider.ManagedInstancesProviderProperty( infrastructure_role_arn="infrastructureRoleArn", instance_launch_template=ecs.CfnCapacityProvider.InstanceLaunchTemplateProperty( ec2_instance_profile_arn="ec2InstanceProfileArn", network_configuration=ecs.CfnCapacityProvider.ManagedInstancesNetworkConfigurationProperty( subnets=["subnets"], # the properties below are optional security_groups=["securityGroups"] ), # the properties below are optional instance_requirements=ecs.CfnCapacityProvider.InstanceRequirementsRequestProperty( memory_mi_b=ecs.CfnCapacityProvider.MemoryMiBRequestProperty( min=123, # the properties below are optional max=123 ), v_cpu_count=ecs.CfnCapacityProvider.VCpuCountRangeRequestProperty( min=123, # the properties below are optional max=123 ), # the properties below are optional accelerator_count=ecs.CfnCapacityProvider.AcceleratorCountRequestProperty( max=123, min=123 ), accelerator_manufacturers=["acceleratorManufacturers"], accelerator_names=["acceleratorNames"], accelerator_total_memory_mi_b=ecs.CfnCapacityProvider.AcceleratorTotalMemoryMiBRequestProperty( max=123, min=123 ), accelerator_types=["acceleratorTypes"], allowed_instance_types=["allowedInstanceTypes"], bare_metal="bareMetal", baseline_ebs_bandwidth_mbps=ecs.CfnCapacityProvider.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=ecs.CfnCapacityProvider.MemoryGiBPerVCpuRequestProperty( max=123, min=123 ), network_bandwidth_gbps=ecs.CfnCapacityProvider.NetworkBandwidthGbpsRequestProperty( max=123, min=123 ), network_interface_count=ecs.CfnCapacityProvider.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=ecs.CfnCapacityProvider.TotalLocalStorageGBRequestProperty( max=123, min=123 ) ), monitoring="monitoring", storage_configuration=ecs.CfnCapacityProvider.ManagedInstancesStorageConfigurationProperty( storage_size_gi_b=123 ) ), # the properties below are optional propagate_tags="propagateTags" )
Attributes
- infrastructure_role_arn
The Amazon Resource Name (ARN) of the infrastructure role that Amazon ECS assumes to manage instances.
This role must include permissions for Amazon EC2 instance lifecycle management, networking, and any additional AWS services required for your workloads.
For more information, see Amazon ECS infrastructure IAM role in the Amazon ECS Developer Guide .
- instance_launch_template
The launch template that defines how Amazon ECS launches Amazon ECS Managed Instances.
This includes the instance profile for your tasks, network and storage configuration, and instance requirements that determine which Amazon EC2 instance types can be used.
For more information, see Store instance launch parameters in Amazon EC2 launch templates in the Amazon EC2 User Guide .
- propagate_tags
Determines whether tags from the capacity provider are automatically applied to Amazon ECS Managed Instances.
This helps with cost allocation and resource management by ensuring consistent tagging across your infrastructure.
ManagedInstancesStorageConfigurationProperty
- class CfnCapacityProvider.ManagedInstancesStorageConfigurationProperty(*, storage_size_gib)
Bases:
objectThe storage configuration for Amazon ECS Managed Instances.
This defines the root volume configuration for the instances.
- Parameters:
storage_size_gib (
Union[int,float]) – The size of the tasks volume.- See:
- 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_ecs as ecs managed_instances_storage_configuration_property = ecs.CfnCapacityProvider.ManagedInstancesStorageConfigurationProperty( storage_size_gi_b=123 )
Attributes
ManagedScalingProperty
- class CfnCapacityProvider.ManagedScalingProperty(*, instance_warmup_period=None, maximum_scaling_step_size=None, minimum_scaling_step_size=None, status=None, target_capacity=None)
Bases:
objectThe managed scaling settings for the Auto Scaling group capacity provider.
When managed scaling is turned on, Amazon ECS manages the scale-in and scale-out actions of the Auto Scaling group. Amazon ECS manages a target tracking scaling policy using an Amazon ECS managed CloudWatch metric with the specified
targetCapacityvalue as the target value for the metric. For more information, see Using managed scaling in the Amazon Elastic Container Service Developer Guide .If managed scaling is off, the user must manage the scaling of the Auto Scaling group.
- Parameters:
instance_warmup_period (
Union[int,float,None]) – The period of time, in seconds, after a newly launched Amazon EC2 instance can contribute to CloudWatch metrics for Auto Scaling group. If this parameter is omitted, the default value of300seconds is used.maximum_scaling_step_size (
Union[int,float,None]) – The maximum number of Amazon EC2 instances that Amazon ECS will scale out at one time. If this parameter is omitted, the default value of10000is used.minimum_scaling_step_size (
Union[int,float,None]) – The minimum number of Amazon EC2 instances that Amazon ECS will scale out at one time. The scale in process is not affected by this parameter If this parameter is omitted, the default value of1is used. When additional capacity is required, Amazon ECS will scale up the minimum scaling step size even if the actual demand is less than the minimum scaling step size.status (
Optional[str]) – Determines whether to use managed scaling for the capacity provider.target_capacity (
Union[int,float,None]) – The target capacity utilization as a percentage for the capacity provider. The specified value must be greater than0and less than or equal to100. For example, if you want the capacity provider to maintain 10% spare capacity, then that means the utilization is 90%, so use atargetCapacityof90. The default value of100percent results in the Amazon EC2 instances in your Auto Scaling group being completely used.
- See:
- 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_ecs as ecs managed_scaling_property = ecs.CfnCapacityProvider.ManagedScalingProperty( instance_warmup_period=123, maximum_scaling_step_size=123, minimum_scaling_step_size=123, status="status", target_capacity=123 )
Attributes
- instance_warmup_period
The period of time, in seconds, after a newly launched Amazon EC2 instance can contribute to CloudWatch metrics for Auto Scaling group.
If this parameter is omitted, the default value of
300seconds is used.
- maximum_scaling_step_size
The maximum number of Amazon EC2 instances that Amazon ECS will scale out at one time.
If this parameter is omitted, the default value of
10000is used.
- minimum_scaling_step_size
The minimum number of Amazon EC2 instances that Amazon ECS will scale out at one time.
The scale in process is not affected by this parameter If this parameter is omitted, the default value of
1is used.When additional capacity is required, Amazon ECS will scale up the minimum scaling step size even if the actual demand is less than the minimum scaling step size.
- status
Determines whether to use managed scaling for the capacity provider.
- target_capacity
The target capacity utilization as a percentage for the capacity provider.
The specified value must be greater than
0and less than or equal to100. For example, if you want the capacity provider to maintain 10% spare capacity, then that means the utilization is 90%, so use atargetCapacityof90. The default value of100percent results in the Amazon EC2 instances in your Auto Scaling group being completely used.
MemoryGiBPerVCpuRequestProperty
- class CfnCapacityProvider.MemoryGiBPerVCpuRequestProperty(*, max=None, min=None)
Bases:
objectThe minimum and maximum amount of memory per vCPU in gibibytes (GiB).
This helps ensure that instance types have the appropriate memory-to-CPU ratio for your workloads.
- Parameters:
max (
Union[int,float,None]) – The maximum amount of memory per vCPU in GiB. Instance types with a higher memory-to-vCPU ratio are excluded from selection.min (
Union[int,float,None]) – The minimum amount of memory per vCPU in GiB. Instance types with a lower memory-to-vCPU ratio are excluded from selection.
- See:
- 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_ecs as ecs memory_gi_bPer_vCpu_request_property = ecs.CfnCapacityProvider.MemoryGiBPerVCpuRequestProperty( max=123, min=123 )
Attributes
- max
The maximum amount of memory per vCPU in GiB.
Instance types with a higher memory-to-vCPU ratio are excluded from selection.
- min
The minimum amount of memory per vCPU in GiB.
Instance types with a lower memory-to-vCPU ratio are excluded from selection.
MemoryMiBRequestProperty
- class CfnCapacityProvider.MemoryMiBRequestProperty(*, min, max=None)
Bases:
objectThe minimum and maximum amount of memory in mebibytes (MiB) for instance type selection.
This ensures that selected instance types have adequate memory for your workloads.
- Parameters:
min (
Union[int,float]) – The minimum amount of memory in MiB. Instance types with less memory than this value are excluded from selection.max (
Union[int,float,None]) – The maximum amount of memory in MiB. Instance types with more memory than this value are excluded from selection.
- See:
- 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_ecs as ecs memory_mi_bRequest_property = ecs.CfnCapacityProvider.MemoryMiBRequestProperty( min=123, # the properties below are optional max=123 )
Attributes
- max
The maximum amount of memory in MiB.
Instance types with more memory than this value are excluded from selection.
- min
The minimum amount of memory in MiB.
Instance types with less memory than this value are excluded from selection.
NetworkBandwidthGbpsRequestProperty
- class CfnCapacityProvider.NetworkBandwidthGbpsRequestProperty(*, max=None, min=None)
Bases:
objectThe minimum and maximum network bandwidth in gigabits per second (Gbps) for instance type selection.
This is important for network-intensive workloads.
- Parameters:
max (
Union[int,float,None]) – The maximum network bandwidth in Gbps. Instance types with higher network bandwidth are excluded from selection.min (
Union[int,float,None]) – The minimum network bandwidth in Gbps. Instance types with lower network bandwidth are excluded from selection.
- See:
- 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_ecs as ecs network_bandwidth_gbps_request_property = ecs.CfnCapacityProvider.NetworkBandwidthGbpsRequestProperty( max=123, min=123 )
Attributes
- max
The maximum network bandwidth in Gbps.
Instance types with higher network bandwidth are excluded from selection.
- min
The minimum network bandwidth in Gbps.
Instance types with lower network bandwidth are excluded from selection.
NetworkInterfaceCountRequestProperty
- class CfnCapacityProvider.NetworkInterfaceCountRequestProperty(*, max=None, min=None)
Bases:
objectThe minimum and maximum number of network interfaces for instance type selection.
This is useful for workloads that require multiple network interfaces.
- Parameters:
max (
Union[int,float,None]) – The maximum number of network interfaces. Instance types that support more network interfaces are excluded from selection.min (
Union[int,float,None]) – The minimum number of network interfaces. Instance types that support fewer network interfaces are excluded from selection.
- See:
- 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_ecs as ecs network_interface_count_request_property = ecs.CfnCapacityProvider.NetworkInterfaceCountRequestProperty( max=123, min=123 )
Attributes
- max
The maximum number of network interfaces.
Instance types that support more network interfaces are excluded from selection.
- min
The minimum number of network interfaces.
Instance types that support fewer network interfaces are excluded from selection.
TotalLocalStorageGBRequestProperty
- class CfnCapacityProvider.TotalLocalStorageGBRequestProperty(*, max=None, min=None)
Bases:
objectThe minimum and maximum total local storage in gigabytes (GB) for instance types with local storage.
This is useful for workloads that require local storage for temporary data or caching.
- Parameters:
max (
Union[int,float,None]) – The maximum total local storage in GB. Instance types with more local storage are excluded from selection.min (
Union[int,float,None]) – The minimum total local storage in GB. Instance types with less local storage are excluded from selection.
- See:
- 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_ecs as ecs total_local_storage_gBRequest_property = ecs.CfnCapacityProvider.TotalLocalStorageGBRequestProperty( max=123, min=123 )
Attributes
- max
The maximum total local storage in GB.
Instance types with more local storage are excluded from selection.
- min
The minimum total local storage in GB.
Instance types with less local storage are excluded from selection.
VCpuCountRangeRequestProperty
- class CfnCapacityProvider.VCpuCountRangeRequestProperty(*, min, max=None)
Bases:
objectThe minimum and maximum number of vCPUs for instance type selection.
This allows you to specify a range of vCPU counts that meet your workload requirements.
- Parameters:
min (
Union[int,float]) – The minimum number of vCPUs. Instance types with fewer vCPUs than this value are excluded from selection.max (
Union[int,float,None]) – The maximum number of vCPUs. Instance types with more vCPUs than this value are excluded from selection.
- See:
- 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_ecs as ecs v_cpu_count_range_request_property = ecs.CfnCapacityProvider.VCpuCountRangeRequestProperty( min=123, # the properties below are optional max=123 )
Attributes
- max
The maximum number of vCPUs.
Instance types with more vCPUs than this value are excluded from selection.
- min
The minimum number of vCPUs.
Instance types with fewer vCPUs than this value are excluded from selection.