CfnFlywheelPropsMixin

class aws_cdk.mixins_preview.aws_comprehend.mixins.CfnFlywheelPropsMixin(props, *, strategy=None)

Bases: Mixin

A flywheel is an AWS resource that orchestrates the ongoing training of a model for custom classification or custom entity recognition.

You can create a flywheel to start with an existing trained model, or Comprehend can create and train a new model.

When you create the flywheel, Comprehend creates a data lake in your account. The data lake holds the training data and test data for all versions of the model.

To use a flywheel with an existing trained model, you specify the active model version. Comprehend copies the model’s training data and test data into the flywheel’s data lake.

To use the flywheel with a new model, you need to provide a dataset for training data (and optional test data) when you create the flywheel.

For more information about flywheels, see Flywheel overview in the Amazon Comprehend Developer Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-comprehend-flywheel.html

CloudformationResource:

AWS::Comprehend::Flywheel

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_comprehend import mixins as comprehend_mixins

cfn_flywheel_props_mixin = comprehend_mixins.CfnFlywheelPropsMixin(comprehend_mixins.CfnFlywheelMixinProps(
    active_model_arn="activeModelArn",
    data_access_role_arn="dataAccessRoleArn",
    data_lake_s3_uri="dataLakeS3Uri",
    data_security_config=comprehend_mixins.CfnFlywheelPropsMixin.DataSecurityConfigProperty(
        data_lake_kms_key_id="dataLakeKmsKeyId",
        model_kms_key_id="modelKmsKeyId",
        volume_kms_key_id="volumeKmsKeyId",
        vpc_config=comprehend_mixins.CfnFlywheelPropsMixin.VpcConfigProperty(
            security_group_ids=["securityGroupIds"],
            subnets=["subnets"]
        )
    ),
    flywheel_name="flywheelName",
    model_type="modelType",
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    task_config=comprehend_mixins.CfnFlywheelPropsMixin.TaskConfigProperty(
        document_classification_config=comprehend_mixins.CfnFlywheelPropsMixin.DocumentClassificationConfigProperty(
            labels=["labels"],
            mode="mode"
        ),
        entity_recognition_config=comprehend_mixins.CfnFlywheelPropsMixin.EntityRecognitionConfigProperty(
            entity_types=[comprehend_mixins.CfnFlywheelPropsMixin.EntityTypesListItemProperty(
                type="type"
            )]
        ),
        language_code="languageCode"
    )
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::Comprehend::Flywheel.

Parameters:
  • props (Union[CfnFlywheelMixinProps, Dict[str, Any]]) – L1 properties to apply.

  • strategy (Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE

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 = ['activeModelArn', 'dataAccessRoleArn', 'dataLakeS3Uri', 'dataSecurityConfig', 'flywheelName', 'modelType', 'tags', 'taskConfig']

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

DataSecurityConfigProperty

class CfnFlywheelPropsMixin.DataSecurityConfigProperty(*, data_lake_kms_key_id=None, model_kms_key_id=None, volume_kms_key_id=None, vpc_config=None)

Bases: object

Data security configuration.

Parameters:
  • data_lake_kms_key_id (Optional[str]) – ID for the AWS key that Amazon Comprehend uses to encrypt the data in the data lake.

  • model_kms_key_id (Optional[str]) – ID for the AWS key that Amazon Comprehend uses to encrypt trained custom models. The ModelKmsKeyId can be either of the following formats: - KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab" - Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"

  • volume_kms_key_id (Optional[str]) – ID for the AWS key that Amazon Comprehend uses to encrypt the volume.

  • vpc_config (Union[IResolvable, VpcConfigProperty, Dict[str, Any], None]) – Configuration parameters for an optional private Virtual Private Cloud (VPC) containing the resources you are using for the job. For more information, see Amazon VPC .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-comprehend-flywheel-datasecurityconfig.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_comprehend import mixins as comprehend_mixins

data_security_config_property = comprehend_mixins.CfnFlywheelPropsMixin.DataSecurityConfigProperty(
    data_lake_kms_key_id="dataLakeKmsKeyId",
    model_kms_key_id="modelKmsKeyId",
    volume_kms_key_id="volumeKmsKeyId",
    vpc_config=comprehend_mixins.CfnFlywheelPropsMixin.VpcConfigProperty(
        security_group_ids=["securityGroupIds"],
        subnets=["subnets"]
    )
)

Attributes

data_lake_kms_key_id

ID for the AWS key that Amazon Comprehend uses to encrypt the data in the data lake.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-comprehend-flywheel-datasecurityconfig.html#cfn-comprehend-flywheel-datasecurityconfig-datalakekmskeyid

model_kms_key_id

ID for the AWS key that Amazon Comprehend uses to encrypt trained custom models.

The ModelKmsKeyId can be either of the following formats:

  • KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab"

  • Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-comprehend-flywheel-datasecurityconfig.html#cfn-comprehend-flywheel-datasecurityconfig-modelkmskeyid

volume_kms_key_id

ID for the AWS key that Amazon Comprehend uses to encrypt the volume.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-comprehend-flywheel-datasecurityconfig.html#cfn-comprehend-flywheel-datasecurityconfig-volumekmskeyid

vpc_config

Configuration parameters for an optional private Virtual Private Cloud (VPC) containing the resources you are using for the job.

For more information, see Amazon VPC .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-comprehend-flywheel-datasecurityconfig.html#cfn-comprehend-flywheel-datasecurityconfig-vpcconfig

DocumentClassificationConfigProperty

class CfnFlywheelPropsMixin.DocumentClassificationConfigProperty(*, labels=None, mode=None)

Bases: object

Configuration required for a document classification model.

Parameters:
  • labels (Optional[Sequence[str]]) – One or more labels to associate with the custom classifier.

  • mode (Optional[str]) – Classification mode indicates whether the documents are MULTI_CLASS or MULTI_LABEL .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-comprehend-flywheel-documentclassificationconfig.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_comprehend import mixins as comprehend_mixins

document_classification_config_property = comprehend_mixins.CfnFlywheelPropsMixin.DocumentClassificationConfigProperty(
    labels=["labels"],
    mode="mode"
)

Attributes

labels

One or more labels to associate with the custom classifier.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-comprehend-flywheel-documentclassificationconfig.html#cfn-comprehend-flywheel-documentclassificationconfig-labels

mode

Classification mode indicates whether the documents are MULTI_CLASS or MULTI_LABEL .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-comprehend-flywheel-documentclassificationconfig.html#cfn-comprehend-flywheel-documentclassificationconfig-mode

EntityRecognitionConfigProperty

class CfnFlywheelPropsMixin.EntityRecognitionConfigProperty(*, entity_types=None)

Bases: object

Configuration required for an entity recognition model.

Parameters:

entity_types (Union[IResolvable, Sequence[Union[IResolvable, EntityTypesListItemProperty, Dict[str, Any]]], None]) – Up to 25 entity types that the model is trained to recognize.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-comprehend-flywheel-entityrecognitionconfig.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_comprehend import mixins as comprehend_mixins

entity_recognition_config_property = comprehend_mixins.CfnFlywheelPropsMixin.EntityRecognitionConfigProperty(
    entity_types=[comprehend_mixins.CfnFlywheelPropsMixin.EntityTypesListItemProperty(
        type="type"
    )]
)

Attributes

entity_types

Up to 25 entity types that the model is trained to recognize.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-comprehend-flywheel-entityrecognitionconfig.html#cfn-comprehend-flywheel-entityrecognitionconfig-entitytypes

EntityTypesListItemProperty

class CfnFlywheelPropsMixin.EntityTypesListItemProperty(*, type=None)

Bases: object

An entity type within a labeled training dataset that Amazon Comprehend uses to train a custom entity recognizer.

Parameters:

type (Optional[str]) – An entity type within a labeled training dataset that Amazon Comprehend uses to train a custom entity recognizer. Entity types must not contain the following invalid characters: n (line break), n (escaped line break, r (carriage return), r (escaped carriage return), t (tab), t (escaped tab), and , (comma).

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-comprehend-flywheel-entitytypeslistitem.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_comprehend import mixins as comprehend_mixins

entity_types_list_item_property = comprehend_mixins.CfnFlywheelPropsMixin.EntityTypesListItemProperty(
    type="type"
)

Attributes

type

An entity type within a labeled training dataset that Amazon Comprehend uses to train a custom entity recognizer.

Entity types must not contain the following invalid characters: n (line break), n (escaped line break, r (carriage return), r (escaped carriage return), t (tab), t (escaped tab), and , (comma).

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-comprehend-flywheel-entitytypeslistitem.html#cfn-comprehend-flywheel-entitytypeslistitem-type

TaskConfigProperty

class CfnFlywheelPropsMixin.TaskConfigProperty(*, document_classification_config=None, entity_recognition_config=None, language_code=None)

Bases: object

Configuration about the model associated with a flywheel.

Parameters:
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-comprehend-flywheel-taskconfig.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_comprehend import mixins as comprehend_mixins

task_config_property = comprehend_mixins.CfnFlywheelPropsMixin.TaskConfigProperty(
    document_classification_config=comprehend_mixins.CfnFlywheelPropsMixin.DocumentClassificationConfigProperty(
        labels=["labels"],
        mode="mode"
    ),
    entity_recognition_config=comprehend_mixins.CfnFlywheelPropsMixin.EntityRecognitionConfigProperty(
        entity_types=[comprehend_mixins.CfnFlywheelPropsMixin.EntityTypesListItemProperty(
            type="type"
        )]
    ),
    language_code="languageCode"
)

Attributes

document_classification_config

Configuration required for a document classification model.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-comprehend-flywheel-taskconfig.html#cfn-comprehend-flywheel-taskconfig-documentclassificationconfig

entity_recognition_config

Configuration required for an entity recognition model.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-comprehend-flywheel-taskconfig.html#cfn-comprehend-flywheel-taskconfig-entityrecognitionconfig

language_code

Language code for the language that the model supports.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-comprehend-flywheel-taskconfig.html#cfn-comprehend-flywheel-taskconfig-languagecode

VpcConfigProperty

class CfnFlywheelPropsMixin.VpcConfigProperty(*, security_group_ids=None, subnets=None)

Bases: object

Configuration parameters for an optional private Virtual Private Cloud (VPC) containing the resources you are using for the job.

For more information, see Amazon VPC .

Parameters:
  • security_group_ids (Optional[Sequence[str]]) – The ID number for a security group on an instance of your private VPC. Security groups on your VPC function serve as a virtual firewall to control inbound and outbound traffic and provides security for the resources that you’ll be accessing on the VPC. This ID number is preceded by “sg-”, for instance: “sg-03b388029b0a285ea”. For more information, see Security Groups for your VPC .

  • subnets (Optional[Sequence[str]]) – The ID for each subnet being used in your private VPC. This subnet is a subset of the a range of IPv4 addresses used by the VPC and is specific to a given availability zone in the VPC’s Region. This ID number is preceded by “subnet-”, for instance: “subnet-04ccf456919e69055”. For more information, see VPCs and Subnets .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-comprehend-flywheel-vpcconfig.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_comprehend import mixins as comprehend_mixins

vpc_config_property = comprehend_mixins.CfnFlywheelPropsMixin.VpcConfigProperty(
    security_group_ids=["securityGroupIds"],
    subnets=["subnets"]
)

Attributes

security_group_ids

The ID number for a security group on an instance of your private VPC.

Security groups on your VPC function serve as a virtual firewall to control inbound and outbound traffic and provides security for the resources that you’ll be accessing on the VPC. This ID number is preceded by “sg-”, for instance: “sg-03b388029b0a285ea”. For more information, see Security Groups for your VPC .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-comprehend-flywheel-vpcconfig.html#cfn-comprehend-flywheel-vpcconfig-securitygroupids

subnets

The ID for each subnet being used in your private VPC.

This subnet is a subset of the a range of IPv4 addresses used by the VPC and is specific to a given availability zone in the VPC’s Region. This ID number is preceded by “subnet-”, for instance: “subnet-04ccf456919e69055”. For more information, see VPCs and Subnets .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-comprehend-flywheel-vpcconfig.html#cfn-comprehend-flywheel-vpcconfig-subnets