CfnTask

class aws_cdk.aws_datasync.CfnTask(scope, id, *, destination_location_arn, source_location_arn, cloud_watch_log_group_arn=None, excludes=None, includes=None, name=None, options=None, schedule=None, tags=None)

Bases: CfnResource

A CloudFormation AWS::DataSync::Task.

The AWS::DataSync::Task resource specifies a task. A task is a set of two locations (source and destination) and a set of Options that you use to control the behavior of a task. If you don’t specify Options when you create a task, AWS DataSync populates them with service defaults.

CloudformationResource:

AWS::DataSync::Task

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-task.html

ExampleMetadata:

fixture=_generated

Example:

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

cfn_task = datasync.CfnTask(self, "MyCfnTask",
    destination_location_arn="destinationLocationArn",
    source_location_arn="sourceLocationArn",

    # the properties below are optional
    cloud_watch_log_group_arn="cloudWatchLogGroupArn",
    excludes=[datasync.CfnTask.FilterRuleProperty(
        filter_type="filterType",
        value="value"
    )],
    includes=[datasync.CfnTask.FilterRuleProperty(
        filter_type="filterType",
        value="value"
    )],
    name="name",
    options=datasync.CfnTask.OptionsProperty(
        atime="atime",
        bytes_per_second=123,
        gid="gid",
        log_level="logLevel",
        mtime="mtime",
        object_tags="objectTags",
        overwrite_mode="overwriteMode",
        posix_permissions="posixPermissions",
        preserve_deleted_files="preserveDeletedFiles",
        preserve_devices="preserveDevices",
        security_descriptor_copy_flags="securityDescriptorCopyFlags",
        task_queueing="taskQueueing",
        transfer_mode="transferMode",
        uid="uid",
        verify_mode="verifyMode"
    ),
    schedule=datasync.CfnTask.TaskScheduleProperty(
        schedule_expression="scheduleExpression"
    ),
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)

Create a new AWS::DataSync::Task.

Parameters:
  • scope (Construct) –

    • scope in which this resource is defined.

  • id (str) –

    • scoped id of the resource.

  • destination_location_arn (str) – The Amazon Resource Name (ARN) of an AWS storage resource’s location.

  • source_location_arn (str) – The Amazon Resource Name (ARN) of the source location for the task.

  • cloud_watch_log_group_arn (Optional[str]) – The Amazon Resource Name (ARN) of the Amazon CloudWatch log group that is used to monitor and log events in the task. For more information about how to use CloudWatch Logs with DataSync, see Monitoring Your Task in the AWS DataSync User Guide. For more information about these groups, see Working with Log Groups and Log Streams in the Amazon CloudWatch Logs User Guide .

  • excludes (Union[IResolvable, Sequence[Union[IResolvable, FilterRuleProperty, Dict[str, Any]]], None]) – Specifies a list of filter rules that exclude specific data during your transfer. For more information and examples, see Filtering data transferred by DataSync .

  • includes (Union[IResolvable, Sequence[Union[IResolvable, FilterRuleProperty, Dict[str, Any]]], None]) –

    Specifies a list of filter rules that include specific data during your transfer. For more information and examples, see Filtering data transferred by DataSync .

  • name (Optional[str]) – The name of a task. This value is a text reference that is used to identify the task in the console.

  • options (Union[IResolvable, OptionsProperty, Dict[str, Any], None]) – Specifies the configuration options for a task. Some options include preserving file or object metadata and verifying data integrity. You can also override these options before starting an individual run of a task (also known as a task execution ). For more information, see StartTaskExecution .

  • schedule (Union[IResolvable, TaskScheduleProperty, Dict[str, Any], None]) – Specifies a schedule used to periodically transfer files from a source to a destination location. The schedule should be specified in UTC time. For more information, see Scheduling your task .

  • tags (Optional[Sequence[Union[CfnTag, Dict[str, Any]]]]) – Specifies the tags that you want to apply to the Amazon Resource Name (ARN) representing the task. Tags are key-value pairs that help you manage, filter, and search for your DataSync resources.

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_depends_on(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_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 intermdediate 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).

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 resoure, please consult that specific resource’s documentation.

Return type:

None

get_att(attribute_name)

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.

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

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

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::DataSync::Task'
attr_destination_network_interface_arns

The ARNs of the destination elastic network interfaces (ENIs) that were created for your subnet.

CloudformationAttribute:

DestinationNetworkInterfaceArns

attr_source_network_interface_arns

The ARNs of the source ENIs that were created for your subnet.

CloudformationAttribute:

SourceNetworkInterfaceArns

attr_status

The status of the task that was described.

CloudformationAttribute:

Status

attr_task_arn

The ARN of the task.

CloudformationAttribute:

TaskArn

cfn_options

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

cfn_resource_type

AWS resource type.

cloud_watch_log_group_arn

The Amazon Resource Name (ARN) of the Amazon CloudWatch log group that is used to monitor and log events in the task.

For more information about how to use CloudWatch Logs with DataSync, see Monitoring Your Task in the AWS DataSync User Guide.

For more information about these groups, see Working with Log Groups and Log Streams in the Amazon CloudWatch Logs User Guide .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-task.html#cfn-datasync-task-cloudwatchloggrouparn

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.

destination_location_arn

The Amazon Resource Name (ARN) of an AWS storage resource’s location.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-task.html#cfn-datasync-task-destinationlocationarn

excludes

Specifies a list of filter rules that exclude specific data during your transfer.

For more information and examples, see Filtering data transferred by DataSync .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-task.html#cfn-datasync-task-excludes

includes

Specifies a list of filter rules that include specific data during your transfer.

For more information and examples, see Filtering data transferred by DataSync .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-task.html#cfn-datasync-task-includes

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.

name

The name of a task.

This value is a text reference that is used to identify the task in the console.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-task.html#cfn-datasync-task-name

node

The construct tree node associated with this construct.

options

Specifies the configuration options for a task. Some options include preserving file or object metadata and verifying data integrity.

You can also override these options before starting an individual run of a task (also known as a task execution ). For more information, see StartTaskExecution .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-task.html#cfn-datasync-task-options

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

schedule

Specifies a schedule used to periodically transfer files from a source to a destination location.

The schedule should be specified in UTC time. For more information, see Scheduling your task .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-task.html#cfn-datasync-task-schedule

source_location_arn

The Amazon Resource Name (ARN) of the source location for the task.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-task.html#cfn-datasync-task-sourcelocationarn

stack

The stack in which this element is defined.

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

tags

Specifies the tags that you want to apply to the Amazon Resource Name (ARN) representing the task.

Tags are key-value pairs that help you manage, filter, and search for your DataSync resources.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datasync-task.html#cfn-datasync-task-tags

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(construct)

Check whether the given construct is a CfnResource.

Parameters:

construct (IConstruct)

Return type:

bool

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters:

x (Any)

Return type:

bool

FilterRuleProperty

class CfnTask.FilterRuleProperty(*, filter_type=None, value=None)

Bases: object

Specifies which files, folders, and objects to include or exclude when transferring files from source to destination.

Parameters:
  • filter_type (Optional[str]) – The type of filter rule to apply. AWS DataSync only supports the SIMPLE_PATTERN rule type.

  • value (Optional[str]) – A single filter string that consists of the patterns to include or exclude. The patterns are delimited by “|” (that is, a pipe), for example: /folder1|/folder2

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datasync-task-filterrule.html

ExampleMetadata:

fixture=_generated

Example:

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

filter_rule_property = datasync.CfnTask.FilterRuleProperty(
    filter_type="filterType",
    value="value"
)

Attributes

filter_type

The type of filter rule to apply.

AWS DataSync only supports the SIMPLE_PATTERN rule type.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datasync-task-filterrule.html#cfn-datasync-task-filterrule-filtertype

value

A single filter string that consists of the patterns to include or exclude.

The patterns are delimited by “|” (that is, a pipe), for example: /folder1|/folder2

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datasync-task-filterrule.html#cfn-datasync-task-filterrule-value

OptionsProperty

class CfnTask.OptionsProperty(*, atime=None, bytes_per_second=None, gid=None, log_level=None, mtime=None, object_tags=None, overwrite_mode=None, posix_permissions=None, preserve_deleted_files=None, preserve_devices=None, security_descriptor_copy_flags=None, task_queueing=None, transfer_mode=None, uid=None, verify_mode=None)

Bases: object

Represents the options that are available to control the behavior of a StartTaskExecution operation. This behavior includes preserving metadata, such as user ID (UID), group ID (GID), and file permissions; overwriting files in the destination; data integrity verification; and so on.

A task has a set of default options associated with it. If you don’t specify an option in StartTaskExecution , the default value is used. You can override the default options on each task execution by specifying an overriding Options value to StartTaskExecution .

Parameters:
  • atime (Optional[str]) – A file metadata value that shows the last time that a file was accessed (that is, when the file was read or written to). If you set Atime to BEST_EFFORT , AWS DataSync attempts to preserve the original Atime attribute on all source files (that is, the version before the PREPARING phase). However, Atime ‘s behavior is not fully standard across platforms, so AWS DataSync can only do this on a best-effort basis. Default value: BEST_EFFORT BEST_EFFORT : Attempt to preserve the per-file Atime value (recommended). NONE : Ignore Atime . .. epigraph:: If Atime is set to BEST_EFFORT , Mtime must be set to PRESERVE . If Atime is set to NONE , Mtime must also be NONE .

  • bytes_per_second (Union[int, float, None]) – A value that limits the bandwidth used by AWS DataSync . For example, if you want AWS DataSync to use a maximum of 1 MB, set this value to 1048576 (=1024*1024).

  • gid (Optional[str]) – The group ID (GID) of the file’s owners. Default value: INT_VALUE INT_VALUE : Preserve the integer value of the user ID (UID) and group ID (GID) (recommended). NAME : Currently not supported. NONE : Ignore the UID and GID.

  • log_level (Optional[str]) – Specifies the type of logs that DataSync publishes to a Amazon CloudWatch Logs log group. To specify the log group, see CloudWatchLogGroupArn . If you set LogLevel to OFF , no logs are published. BASIC publishes logs on errors for individual files transferred. TRANSFER publishes logs for every file or object that is transferred and integrity checked.

  • mtime (Optional[str]) – A value that indicates the last time that a file was modified (that is, a file was written to) before the PREPARING phase. This option is required for cases when you need to run the same task more than one time. Default value: PRESERVE PRESERVE : Preserve original Mtime (recommended) NONE : Ignore Mtime . .. epigraph:: If Mtime is set to PRESERVE , Atime must be set to BEST_EFFORT . If Mtime is set to NONE , Atime must also be set to NONE .

  • object_tags (Optional[str]) – Specifies whether object tags are preserved when transferring between object storage systems. If you want your DataSync task to ignore object tags, specify the NONE value. Default Value: PRESERVE

  • overwrite_mode (Optional[str]) – Specifies whether data at the destination location should be overwritten or preserved. If set to NEVER , a destination file for example will not be replaced by a source file (even if the destination file differs from the source file). If you modify files in the destination and you sync the files, you can use this value to protect against overwriting those changes. Some storage classes have specific behaviors that can affect your Amazon S3 storage cost. For detailed information, see Considerations when working with Amazon S3 storage classes in DataSync .

  • posix_permissions (Optional[str]) – A value that determines which users or groups can access a file for a specific purpose, such as reading, writing, or execution of the file. This option should be set only for Network File System (NFS), Amazon EFS, and Amazon S3 locations. For more information about what metadata is copied by DataSync, see Metadata Copied by DataSync . Default value: PRESERVE PRESERVE : Preserve POSIX-style permissions (recommended). NONE : Ignore permissions. .. epigraph:: AWS DataSync can preserve extant permissions of a source location.

  • preserve_deleted_files (Optional[str]) –

    A value that specifies whether files in the destination that don’t exist in the source file system are preserved. This option can affect your storage costs. If your task deletes objects, you might incur minimum storage duration charges for certain storage classes. For detailed information, see Considerations when working with Amazon S3 storage classes in DataSync in the AWS DataSync User Guide . Default value: PRESERVE PRESERVE : Ignore destination files that aren’t present in the source (recommended). REMOVE : Delete destination files that aren’t present in the source.

  • preserve_devices (Optional[str]) – A value that determines whether AWS DataSync should preserve the metadata of block and character devices in the source file system, and re-create the files with that device name and metadata on the destination. DataSync does not copy the contents of such devices, only the name and metadata. .. epigraph:: AWS DataSync can’t sync the actual contents of such devices, because they are nonterminal and don’t return an end-of-file (EOF) marker. Default value: NONE NONE : Ignore special devices (recommended). PRESERVE : Preserve character and block device metadata. This option isn’t currently supported for Amazon EFS.

  • security_descriptor_copy_flags (Optional[str]) – A value that determines which components of the SMB security descriptor are copied from source to destination objects. This value is only used for transfers between SMB and Amazon FSx for Windows File Server locations, or between two Amazon FSx for Windows File Server locations. For more information about how DataSync handles metadata, see How DataSync Handles Metadata and Special Files . Default value: OWNER_DACL OWNER_DACL : For each copied object, DataSync copies the following metadata: - Object owner. - NTFS discretionary access control lists (DACLs), which determine whether to grant access to an object. When you use option, DataSync does NOT copy the NTFS system access control lists (SACLs), which are used by administrators to log attempts to access a secured object. OWNER_DACL_SACL : For each copied object, DataSync copies the following metadata: - Object owner. - NTFS discretionary access control lists (DACLs), which determine whether to grant access to an object. - NTFS system access control lists (SACLs), which are used by administrators to log attempts to access a secured object. Copying SACLs requires granting additional permissions to the Windows user that DataSync uses to access your SMB location. For information about choosing a user that ensures sufficient permissions to files, folders, and metadata, see user . NONE : None of the SMB security descriptor components are copied. Destination objects are owned by the user that was provided for accessing the destination location. DACLs and SACLs are set based on the destination server’s configuration.

  • task_queueing (Optional[str]) – Specifies whether your transfer tasks should be put into a queue during certain scenarios when running multiple tasks . This is ENABLED by default.

  • transfer_mode (Optional[str]) – A value that determines whether DataSync transfers only the data and metadata that differ between the source and the destination location, or whether DataSync transfers all the content from the source, without comparing it to the destination location. CHANGED : DataSync copies only data or metadata that is new or different from the source location to the destination location. ALL : DataSync copies all source location content to the destination, without comparing it to existing content on the destination.

  • uid (Optional[str]) – The user ID (UID) of the file’s owner. Default value: INT_VALUE INT_VALUE : Preserve the integer value of the UID and group ID (GID) (recommended). NAME : Currently not supported NONE : Ignore the UID and GID.

  • verify_mode (Optional[str]) – A value that determines whether a data integrity verification is performed at the end of a task execution after all data and metadata have been transferred. For more information, see Configure task settings . Default value: POINT_IN_TIME_CONSISTENT ONLY_FILES_TRANSFERRED (recommended): Perform verification only on files that were transferred. POINT_IN_TIME_CONSISTENT : Scan the entire source and entire destination at the end of the transfer to verify that the source and destination are fully synchronized. This option isn’t supported when transferring to S3 Glacier or S3 Glacier Deep Archive storage classes. NONE : No additional verification is done at the end of the transfer, but all data transmissions are integrity-checked with checksum verification during the transfer.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datasync-task-options.html

ExampleMetadata:

fixture=_generated

Example:

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

options_property = datasync.CfnTask.OptionsProperty(
    atime="atime",
    bytes_per_second=123,
    gid="gid",
    log_level="logLevel",
    mtime="mtime",
    object_tags="objectTags",
    overwrite_mode="overwriteMode",
    posix_permissions="posixPermissions",
    preserve_deleted_files="preserveDeletedFiles",
    preserve_devices="preserveDevices",
    security_descriptor_copy_flags="securityDescriptorCopyFlags",
    task_queueing="taskQueueing",
    transfer_mode="transferMode",
    uid="uid",
    verify_mode="verifyMode"
)

Attributes

atime

A file metadata value that shows the last time that a file was accessed (that is, when the file was read or written to).

If you set Atime to BEST_EFFORT , AWS DataSync attempts to preserve the original Atime attribute on all source files (that is, the version before the PREPARING phase). However, Atime ‘s behavior is not fully standard across platforms, so AWS DataSync can only do this on a best-effort basis.

Default value: BEST_EFFORT

BEST_EFFORT : Attempt to preserve the per-file Atime value (recommended).

NONE : Ignore Atime . .. epigraph:

If ``Atime`` is set to ``BEST_EFFORT`` , ``Mtime`` must be set to ``PRESERVE`` .

If ``Atime`` is set to ``NONE`` , ``Mtime`` must also be ``NONE`` .
Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datasync-task-options.html#cfn-datasync-task-options-atime

bytes_per_second

A value that limits the bandwidth used by AWS DataSync .

For example, if you want AWS DataSync to use a maximum of 1 MB, set this value to 1048576 (=1024*1024).

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datasync-task-options.html#cfn-datasync-task-options-bytespersecond

gid

The group ID (GID) of the file’s owners.

Default value: INT_VALUE

INT_VALUE : Preserve the integer value of the user ID (UID) and group ID (GID) (recommended).

NAME : Currently not supported.

NONE : Ignore the UID and GID.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datasync-task-options.html#cfn-datasync-task-options-gid

log_level

Specifies the type of logs that DataSync publishes to a Amazon CloudWatch Logs log group.

To specify the log group, see CloudWatchLogGroupArn .

If you set LogLevel to OFF , no logs are published. BASIC publishes logs on errors for individual files transferred. TRANSFER publishes logs for every file or object that is transferred and integrity checked.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datasync-task-options.html#cfn-datasync-task-options-loglevel

mtime

A value that indicates the last time that a file was modified (that is, a file was written to) before the PREPARING phase.

This option is required for cases when you need to run the same task more than one time.

Default value: PRESERVE

PRESERVE : Preserve original Mtime (recommended)

NONE : Ignore Mtime . .. epigraph:

If ``Mtime`` is set to ``PRESERVE`` , ``Atime`` must be set to ``BEST_EFFORT`` .

If ``Mtime`` is set to ``NONE`` , ``Atime`` must also be set to ``NONE`` .
Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datasync-task-options.html#cfn-datasync-task-options-mtime

object_tags

Specifies whether object tags are preserved when transferring between object storage systems.

If you want your DataSync task to ignore object tags, specify the NONE value.

Default Value: PRESERVE

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datasync-task-options.html#cfn-datasync-task-options-objecttags

overwrite_mode

Specifies whether data at the destination location should be overwritten or preserved.

If set to NEVER , a destination file for example will not be replaced by a source file (even if the destination file differs from the source file). If you modify files in the destination and you sync the files, you can use this value to protect against overwriting those changes.

Some storage classes have specific behaviors that can affect your Amazon S3 storage cost. For detailed information, see Considerations when working with Amazon S3 storage classes in DataSync .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datasync-task-options.html#cfn-datasync-task-options-overwritemode

posix_permissions

A value that determines which users or groups can access a file for a specific purpose, such as reading, writing, or execution of the file.

This option should be set only for Network File System (NFS), Amazon EFS, and Amazon S3 locations. For more information about what metadata is copied by DataSync, see Metadata Copied by DataSync .

Default value: PRESERVE

PRESERVE : Preserve POSIX-style permissions (recommended).

NONE : Ignore permissions. .. epigraph:

AWS DataSync can preserve extant permissions of a source location.
Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datasync-task-options.html#cfn-datasync-task-options-posixpermissions

preserve_deleted_files

A value that specifies whether files in the destination that don’t exist in the source file system are preserved.

This option can affect your storage costs. If your task deletes objects, you might incur minimum storage duration charges for certain storage classes. For detailed information, see Considerations when working with Amazon S3 storage classes in DataSync in the AWS DataSync User Guide .

Default value: PRESERVE

PRESERVE : Ignore destination files that aren’t present in the source (recommended).

REMOVE : Delete destination files that aren’t present in the source.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datasync-task-options.html#cfn-datasync-task-options-preservedeletedfiles

preserve_devices

A value that determines whether AWS DataSync should preserve the metadata of block and character devices in the source file system, and re-create the files with that device name and metadata on the destination.

DataSync does not copy the contents of such devices, only the name and metadata. .. epigraph:

AWS DataSync can't sync the actual contents of such devices, because they are nonterminal and don't return an end-of-file (EOF) marker.

Default value: NONE

NONE : Ignore special devices (recommended).

PRESERVE : Preserve character and block device metadata. This option isn’t currently supported for Amazon EFS.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datasync-task-options.html#cfn-datasync-task-options-preservedevices

security_descriptor_copy_flags

A value that determines which components of the SMB security descriptor are copied from source to destination objects.

This value is only used for transfers between SMB and Amazon FSx for Windows File Server locations, or between two Amazon FSx for Windows File Server locations. For more information about how DataSync handles metadata, see How DataSync Handles Metadata and Special Files .

Default value: OWNER_DACL

OWNER_DACL : For each copied object, DataSync copies the following metadata:

  • Object owner.

  • NTFS discretionary access control lists (DACLs), which determine whether to grant access to an object.

When you use option, DataSync does NOT copy the NTFS system access control lists (SACLs), which are used by administrators to log attempts to access a secured object.

OWNER_DACL_SACL : For each copied object, DataSync copies the following metadata:

  • Object owner.

  • NTFS discretionary access control lists (DACLs), which determine whether to grant access to an object.

  • NTFS system access control lists (SACLs), which are used by administrators to log attempts to access a secured object.

Copying SACLs requires granting additional permissions to the Windows user that DataSync uses to access your SMB location. For information about choosing a user that ensures sufficient permissions to files, folders, and metadata, see user .

NONE : None of the SMB security descriptor components are copied. Destination objects are owned by the user that was provided for accessing the destination location. DACLs and SACLs are set based on the destination server’s configuration.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datasync-task-options.html#cfn-datasync-task-options-securitydescriptorcopyflags

task_queueing

Specifies whether your transfer tasks should be put into a queue during certain scenarios when running multiple tasks . This is ENABLED by default.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datasync-task-options.html#cfn-datasync-task-options-taskqueueing

transfer_mode

A value that determines whether DataSync transfers only the data and metadata that differ between the source and the destination location, or whether DataSync transfers all the content from the source, without comparing it to the destination location.

CHANGED : DataSync copies only data or metadata that is new or different from the source location to the destination location.

ALL : DataSync copies all source location content to the destination, without comparing it to existing content on the destination.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datasync-task-options.html#cfn-datasync-task-options-transfermode

uid

The user ID (UID) of the file’s owner.

Default value: INT_VALUE

INT_VALUE : Preserve the integer value of the UID and group ID (GID) (recommended).

NAME : Currently not supported

NONE : Ignore the UID and GID.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datasync-task-options.html#cfn-datasync-task-options-uid

verify_mode

A value that determines whether a data integrity verification is performed at the end of a task execution after all data and metadata have been transferred.

For more information, see Configure task settings .

Default value: POINT_IN_TIME_CONSISTENT

ONLY_FILES_TRANSFERRED (recommended): Perform verification only on files that were transferred.

POINT_IN_TIME_CONSISTENT : Scan the entire source and entire destination at the end of the transfer to verify that the source and destination are fully synchronized. This option isn’t supported when transferring to S3 Glacier or S3 Glacier Deep Archive storage classes.

NONE : No additional verification is done at the end of the transfer, but all data transmissions are integrity-checked with checksum verification during the transfer.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datasync-task-options.html#cfn-datasync-task-options-verifymode

TaskScheduleProperty

class CfnTask.TaskScheduleProperty(*, schedule_expression)

Bases: object

Specifies the schedule you want your task to use for repeated executions.

For more information, see Schedule Expressions for Rules .

Parameters:

schedule_expression (str) – A cron expression that specifies when AWS DataSync initiates a scheduled transfer from a source to a destination location.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datasync-task-taskschedule.html

ExampleMetadata:

fixture=_generated

Example:

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

task_schedule_property = datasync.CfnTask.TaskScheduleProperty(
    schedule_expression="scheduleExpression"
)

Attributes

schedule_expression

A cron expression that specifies when AWS DataSync initiates a scheduled transfer from a source to a destination location.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datasync-task-taskschedule.html#cfn-datasync-task-taskschedule-scheduleexpression