CombineStrategyOptions

class aws_cdk.CombineStrategyOptions(*, arrays=None)

Bases: object

Options for the combine strategy.

Parameters:

arrays (Optional[IArrayMergeStrategy]) – Strategy for merging arrays. Default: ArrayMergeStrategy.replace()

ExampleMetadata:

infused

Example:

from aws_cdk.cfn_property_mixins.aws_dynamodb import CfnGlobalTableMixinProps
# TableV2 uses a Box internally for replicas.
# The mixin defers the merge and appends the new replica at synthesis time.
table = dynamodb.TableV2(scope, "Table",
    partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING),
    # L2 prop: pointInTimeRecovery is a boolean
    replicas=[dynamodb.ReplicaTableProps(region="us-east-1", point_in_time_recovery=True)]
)

# Mixins always use L1 (CloudFormation) property names and shapes,
# regardless of what the L2 API looks like.
table.with(CfnGlobalTablePropsMixin(CfnGlobalTableMixinProps(
    replicas=[CfnGlobalTablePropsMixin.ReplicaSpecificationProperty(
        region="eu-west-1",
        # L1 prop: pointInTimeRecoverySpecification is an object
        point_in_time_recovery_specification=CfnGlobalTablePropsMixin.PointInTimeRecoverySpecificationProperty(point_in_time_recovery_enabled=True)
    )]
), strategy=PropertyMergeStrategy.combine(arrays=ArrayMergeStrategy.append())))

Attributes

arrays

Strategy for merging arrays.

Default:

ArrayMergeStrategy.replace()