CfnServiceEnvironmentPropsMixin

class aws_cdk.mixins_preview.aws_batch.mixins.CfnServiceEnvironmentPropsMixin(props, *, strategy=None)

Bases: Mixin

Creates a service environment for running service jobs.

Service environments define capacity limits for specific service types such as SageMaker Training jobs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-batch-serviceenvironment.html

CloudformationResource:

AWS::Batch::ServiceEnvironment

Mixin:

true

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.mixins_preview import mixins
from aws_cdk.mixins_preview.aws_batch import mixins as batch_mixins

cfn_service_environment_props_mixin = batch_mixins.CfnServiceEnvironmentPropsMixin(batch_mixins.CfnServiceEnvironmentMixinProps(
    capacity_limits=[batch_mixins.CfnServiceEnvironmentPropsMixin.CapacityLimitProperty(
        capacity_unit="capacityUnit",
        max_capacity=123
    )],
    service_environment_name="serviceEnvironmentName",
    service_environment_type="serviceEnvironmentType",
    state="state",
    tags={
        "tags_key": "tags"
    }
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::Batch::ServiceEnvironment.

Parameters:

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['capacityLimits', 'serviceEnvironmentName', 'serviceEnvironmentType', 'state', 'tags']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

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

Stability:

experimental

CapacityLimitProperty

class CfnServiceEnvironmentPropsMixin.CapacityLimitProperty(*, capacity_unit=None, max_capacity=None)

Bases: object

Defines the capacity limit for a service environment.

This structure specifies the maximum amount of resources that can be used by service jobs in the environment.

Parameters:
  • capacity_unit (Optional[str]) – The unit of measure for the capacity limit. This defines how the maxCapacity value should be interpreted. For SAGEMAKER_TRAINING jobs, use NUM_INSTANCES .

  • max_capacity (Union[int, float, None]) – The maximum capacity available for the service environment. This value represents the maximum amount resources that can be allocated to service jobs. For example, maxCapacity=50 , capacityUnit=NUM_INSTANCES . This indicates that the maximum number of instances that can be run on this service environment is 50. You could then run 5 SageMaker Training jobs that each use 10 instances. However, if you submit another job that requires 10 instances, it will wait in the queue.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-serviceenvironment-capacitylimit.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.mixins_preview.aws_batch import mixins as batch_mixins

capacity_limit_property = batch_mixins.CfnServiceEnvironmentPropsMixin.CapacityLimitProperty(
    capacity_unit="capacityUnit",
    max_capacity=123
)

Attributes

capacity_unit

The unit of measure for the capacity limit.

This defines how the maxCapacity value should be interpreted. For SAGEMAKER_TRAINING jobs, use NUM_INSTANCES .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-serviceenvironment-capacitylimit.html#cfn-batch-serviceenvironment-capacitylimit-capacityunit

max_capacity

The maximum capacity available for the service environment.

This value represents the maximum amount resources that can be allocated to service jobs.

For example, maxCapacity=50 , capacityUnit=NUM_INSTANCES . This indicates that the maximum number of instances that can be run on this service environment is 50. You could then run 5 SageMaker Training jobs that each use 10 instances. However, if you submit another job that requires 10 instances, it will wait in the queue.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-serviceenvironment-capacitylimit.html#cfn-batch-serviceenvironment-capacitylimit-maxcapacity