Skip to content

Latest commit

 

History

History
2109 lines (1287 loc) · 76.6 KB

API.md

File metadata and controls

2109 lines (1287 loc) · 76.6 KB

API Reference

Constructs

AcquireSemaphoreFragment

Initializers

import { AcquireSemaphoreFragment } from 'cdk-concurrency-controller'

new AcquireSemaphoreFragment(scope: Construct, id: string, props: AcquireSemaphoreFragmentProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props AcquireSemaphoreFragmentProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.
next Continue normal execution with the given state.
prefixStates Prefix the IDs of all states in this state machine fragment.
toSingleState Wrap all states in this state machine fragment up into a single state.

toString
public toString(): string

Returns a string representation of this construct.

next
public next(next: IChainable): Chain

Continue normal execution with the given state.

nextRequired
  • Type: aws-cdk-lib.aws_stepfunctions.IChainable

prefixStates
public prefixStates(prefix?: string): StateMachineFragment

Prefix the IDs of all states in this state machine fragment.

Use this to avoid multiple copies of the state machine all having the same state IDs.

prefixOptional
  • Type: string

The prefix to add.

Will use construct ID by default.


toSingleState
public toSingleState(options?: SingleStateOptions): Parallel

Wrap all states in this state machine fragment up into a single state.

This can be used to add retry or error handling onto this state machine fragment.

Be aware that this changes the result of the inner state machine to be an array with the result of the state machine in it. Adjust your paths accordingly. For example, change 'outputPath' to '$[0]'.

optionsOptional
  • Type: aws-cdk-lib.aws_stepfunctions.SingleStateOptions

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { AcquireSemaphoreFragment } from 'cdk-concurrency-controller'

AcquireSemaphoreFragment.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
endStates aws-cdk-lib.aws_stepfunctions.INextable[] The states to chain onto if this fragment is used.
id string Descriptive identifier for this chainable.
startState aws-cdk-lib.aws_stepfunctions.State The start state of this state machine fragment.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


endStatesRequired
public readonly endStates: INextable[];
  • Type: aws-cdk-lib.aws_stepfunctions.INextable[]

The states to chain onto if this fragment is used.


idRequired
public readonly id: string;
  • Type: string

Descriptive identifier for this chainable.


startStateRequired
public readonly startState: State;
  • Type: aws-cdk-lib.aws_stepfunctions.State

The start state of this state machine fragment.


AcquireViaStartExecutionFragment

Initializers

import { AcquireViaStartExecutionFragment } from 'cdk-concurrency-controller'

new AcquireViaStartExecutionFragment(scope: Construct, id: string, props: AcquireViaStartExecutionFragmentProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props AcquireViaStartExecutionFragmentProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.
next Continue normal execution with the given state.
prefixStates Prefix the IDs of all states in this state machine fragment.
toSingleState Wrap all states in this state machine fragment up into a single state.

toString
public toString(): string

Returns a string representation of this construct.

next
public next(next: IChainable): Chain

Continue normal execution with the given state.

nextRequired
  • Type: aws-cdk-lib.aws_stepfunctions.IChainable

prefixStates
public prefixStates(prefix?: string): StateMachineFragment

Prefix the IDs of all states in this state machine fragment.

Use this to avoid multiple copies of the state machine all having the same state IDs.

prefixOptional
  • Type: string

The prefix to add.

Will use construct ID by default.


toSingleState
public toSingleState(options?: SingleStateOptions): Parallel

Wrap all states in this state machine fragment up into a single state.

This can be used to add retry or error handling onto this state machine fragment.

Be aware that this changes the result of the inner state machine to be an array with the result of the state machine in it. Adjust your paths accordingly. For example, change 'outputPath' to '$[0]'.

optionsOptional
  • Type: aws-cdk-lib.aws_stepfunctions.SingleStateOptions

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { AcquireViaStartExecutionFragment } from 'cdk-concurrency-controller'

AcquireViaStartExecutionFragment.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
endStates aws-cdk-lib.aws_stepfunctions.INextable[] The states to chain onto if this fragment is used.
id string Descriptive identifier for this chainable.
startState aws-cdk-lib.aws_stepfunctions.State The start state of this state machine fragment.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


endStatesRequired
public readonly endStates: INextable[];
  • Type: aws-cdk-lib.aws_stepfunctions.INextable[]

The states to chain onto if this fragment is used.


idRequired
public readonly id: string;
  • Type: string

Descriptive identifier for this chainable.


startStateRequired
public readonly startState: State;
  • Type: aws-cdk-lib.aws_stepfunctions.State

The start state of this state machine fragment.


DistributedSemaphore

Initializers

import { DistributedSemaphore } from 'cdk-concurrency-controller'

new DistributedSemaphore(scope: Construct, id: string, props?: DistributedSemaphoreProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props DistributedSemaphoreProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsOptional

Methods

Name Description
toString Returns a string representation of this construct.
acquire Acquire a permit for a limited resource.
release Release the permit for the resource.

toString
public toString(): string

Returns a string representation of this construct.

acquire
public acquire(options?: AcquireOptions): StateMachineFragment

Acquire a permit for a limited resource.

optionsOptional

use default semaphore if not specified.


release
public release(options?: ReleaseOptions): StateMachineFragment

Release the permit for the resource.

optionsOptional

use default semaphore if not specified.


Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { DistributedSemaphore } from 'cdk-concurrency-controller'

DistributedSemaphore.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
acquireSemaphoreStateMachine aws-cdk-lib.aws_stepfunctions.IStateMachine No description.
allSemaphores SemaphoreDefinition[] No description.
cleanupSemaphoreStateMachine aws-cdk-lib.aws_stepfunctions.IStateMachine No description.
defaultSemaphore SemaphoreDefinition No description.
releaseSemaphoreStateMachine aws-cdk-lib.aws_stepfunctions.IStateMachine No description.
semaphoreTable SemaphoreTableDefinition No description.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


acquireSemaphoreStateMachineRequired
public readonly acquireSemaphoreStateMachine: IStateMachine;
  • Type: aws-cdk-lib.aws_stepfunctions.IStateMachine

allSemaphoresRequired
public readonly allSemaphores: SemaphoreDefinition[];

cleanupSemaphoreStateMachineRequired
public readonly cleanupSemaphoreStateMachine: IStateMachine;
  • Type: aws-cdk-lib.aws_stepfunctions.IStateMachine

defaultSemaphoreRequired
public readonly defaultSemaphore: SemaphoreDefinition;

releaseSemaphoreStateMachineRequired
public readonly releaseSemaphoreStateMachine: IStateMachine;
  • Type: aws-cdk-lib.aws_stepfunctions.IStateMachine

semaphoreTableRequired
public readonly semaphoreTable: SemaphoreTableDefinition;

ReleaseSemaphoreFragment

Initializers

import { ReleaseSemaphoreFragment } from 'cdk-concurrency-controller'

new ReleaseSemaphoreFragment(scope: Construct, id: string, props: ReleaseSemaphoreFragmentProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props ReleaseSemaphoreFragmentProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.
next Continue normal execution with the given state.
prefixStates Prefix the IDs of all states in this state machine fragment.
toSingleState Wrap all states in this state machine fragment up into a single state.

toString
public toString(): string

Returns a string representation of this construct.

next
public next(next: IChainable): Chain

Continue normal execution with the given state.

nextRequired
  • Type: aws-cdk-lib.aws_stepfunctions.IChainable

prefixStates
public prefixStates(prefix?: string): StateMachineFragment

Prefix the IDs of all states in this state machine fragment.

Use this to avoid multiple copies of the state machine all having the same state IDs.

prefixOptional
  • Type: string

The prefix to add.

Will use construct ID by default.


toSingleState
public toSingleState(options?: SingleStateOptions): Parallel

Wrap all states in this state machine fragment up into a single state.

This can be used to add retry or error handling onto this state machine fragment.

Be aware that this changes the result of the inner state machine to be an array with the result of the state machine in it. Adjust your paths accordingly. For example, change 'outputPath' to '$[0]'.

optionsOptional
  • Type: aws-cdk-lib.aws_stepfunctions.SingleStateOptions

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { ReleaseSemaphoreFragment } from 'cdk-concurrency-controller'

ReleaseSemaphoreFragment.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
endStates aws-cdk-lib.aws_stepfunctions.INextable[] The states to chain onto if this fragment is used.
id string Descriptive identifier for this chainable.
startState aws-cdk-lib.aws_stepfunctions.State The start state of this state machine fragment.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


endStatesRequired
public readonly endStates: INextable[];
  • Type: aws-cdk-lib.aws_stepfunctions.INextable[]

The states to chain onto if this fragment is used.


idRequired
public readonly id: string;
  • Type: string

Descriptive identifier for this chainable.


startStateRequired
public readonly startState: State;
  • Type: aws-cdk-lib.aws_stepfunctions.State

The start state of this state machine fragment.


ReleaseViaStartExecutionFragment

Initializers

import { ReleaseViaStartExecutionFragment } from 'cdk-concurrency-controller'

new ReleaseViaStartExecutionFragment(scope: Construct, id: string, props: ReleaseViaStartExecutionFragmentProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props ReleaseViaStartExecutionFragmentProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.
next Continue normal execution with the given state.
prefixStates Prefix the IDs of all states in this state machine fragment.
toSingleState Wrap all states in this state machine fragment up into a single state.

toString
public toString(): string

Returns a string representation of this construct.

next
public next(next: IChainable): Chain

Continue normal execution with the given state.

nextRequired
  • Type: aws-cdk-lib.aws_stepfunctions.IChainable

prefixStates
public prefixStates(prefix?: string): StateMachineFragment

Prefix the IDs of all states in this state machine fragment.

Use this to avoid multiple copies of the state machine all having the same state IDs.

prefixOptional
  • Type: string

The prefix to add.

Will use construct ID by default.


toSingleState
public toSingleState(options?: SingleStateOptions): Parallel

Wrap all states in this state machine fragment up into a single state.

This can be used to add retry or error handling onto this state machine fragment.

Be aware that this changes the result of the inner state machine to be an array with the result of the state machine in it. Adjust your paths accordingly. For example, change 'outputPath' to '$[0]'.

optionsOptional
  • Type: aws-cdk-lib.aws_stepfunctions.SingleStateOptions

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { ReleaseViaStartExecutionFragment } from 'cdk-concurrency-controller'

ReleaseViaStartExecutionFragment.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
endStates aws-cdk-lib.aws_stepfunctions.INextable[] The states to chain onto if this fragment is used.
id string Descriptive identifier for this chainable.
startState aws-cdk-lib.aws_stepfunctions.State The start state of this state machine fragment.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


endStatesRequired
public readonly endStates: INextable[];
  • Type: aws-cdk-lib.aws_stepfunctions.INextable[]

The states to chain onto if this fragment is used.


idRequired
public readonly id: string;
  • Type: string

Descriptive identifier for this chainable.


startStateRequired
public readonly startState: State;
  • Type: aws-cdk-lib.aws_stepfunctions.State

The start state of this state machine fragment.


Structs

AcquireOptions

Initializer

import { AcquireOptions } from 'cdk-concurrency-controller'

const acquireOptions: AcquireOptions = { ... }

Properties

Name Type Description
name string The name for the semaphore.
userId string The semaphore user id to acquire/release resource usage.
nextTryWaitTime string Wait a fixed amount of time (in second) for another try to acquire semaphore if not acquired in previous tries.
taskTimeout aws-cdk-lib.aws_stepfunctions.Timeout Maximum run time for the execution.
timeout aws-cdk-lib.Duration Maximum run time for the execution.

nameRequired
public readonly name: string;
  • Type: string

The name for the semaphore.

Or it can be JsonPath expression that extracts the value from the state object at runtime. This allows custom semaphore names from runtime input for multiple resources.

Example value: $.semaphoreName


userIdRequired
public readonly userId: string;
  • Type: string

The semaphore user id to acquire/release resource usage.


nextTryWaitTimeOptional
public readonly nextTryWaitTime: string;
  • Type: string
  • Default: '3' seconds

Wait a fixed amount of time (in second) for another try to acquire semaphore if not acquired in previous tries.


taskTimeoutOptional
public readonly taskTimeout: Timeout;
  • Type: aws-cdk-lib.aws_stepfunctions.Timeout
  • Default: No timeout

Maximum run time for the execution.


timeoutOptional
  • Deprecated: Use taskTimeout instead
public readonly timeout: Duration;
  • Type: aws-cdk-lib.Duration
  • Default: No timeout

Maximum run time for the execution.


AcquireSemaphoreFragmentProps

Initializer

import { AcquireSemaphoreFragmentProps } from 'cdk-concurrency-controller'

const acquireSemaphoreFragmentProps: AcquireSemaphoreFragmentProps = { ... }

Properties

Name Type Description
name string The name for the semaphore.
userId string The semaphore user id to acquire/release resource usage.
nextTryWaitTime string Wait a fixed amount of time (in second) for another try to acquire semaphore if not acquired in previous tries.
limit string The value for concurrency control.
semaphoreTable SemaphoreTableDefinition The DynamoDB table to use for the semaphore.
retryStrategy aws-cdk-lib.aws_stepfunctions.RetryProps Retry strategy on Errors.ALL when releasing a semaphore use from the semaphore table.

nameRequired
public readonly name: string;
  • Type: string

The name for the semaphore.

Or it can be JsonPath expression that extracts the value from the state object at runtime. This allows custom semaphore names from runtime input for multiple resources.

Example value: $.semaphoreName


userIdRequired
public readonly userId: string;
  • Type: string

The semaphore user id to acquire/release resource usage.


nextTryWaitTimeOptional
public readonly nextTryWaitTime: string;
  • Type: string
  • Default: '3' seconds

Wait a fixed amount of time (in second) for another try to acquire semaphore if not acquired in previous tries.


limitRequired
public readonly limit: string;
  • Type: string

The value for concurrency control.


semaphoreTableRequired
public readonly semaphoreTable: SemaphoreTableDefinition;

The DynamoDB table to use for the semaphore.


retryStrategyOptional
public readonly retryStrategy: RetryProps;
  • Type: aws-cdk-lib.aws_stepfunctions.RetryProps
  • Default: '{ interval: Duration.seconds(1), maxAttempts: 5, backoffRate: 1.5 }'

Retry strategy on Errors.ALL when releasing a semaphore use from the semaphore table.

NOTE: errors property is always overridden to [Errors.ALL].


AcquireSemaphoreOptions

Initializer

import { AcquireSemaphoreOptions } from 'cdk-concurrency-controller'

const acquireSemaphoreOptions: AcquireSemaphoreOptions = { ... }

Properties

Name Type Description
name string The name for the semaphore.
userId string The semaphore user id to acquire/release resource usage.
nextTryWaitTime string Wait a fixed amount of time (in second) for another try to acquire semaphore if not acquired in previous tries.

nameRequired
public readonly name: string;
  • Type: string

The name for the semaphore.

Or it can be JsonPath expression that extracts the value from the state object at runtime. This allows custom semaphore names from runtime input for multiple resources.

Example value: $.semaphoreName


userIdRequired
public readonly userId: string;
  • Type: string

The semaphore user id to acquire/release resource usage.


nextTryWaitTimeOptional
public readonly nextTryWaitTime: string;
  • Type: string
  • Default: '3' seconds

Wait a fixed amount of time (in second) for another try to acquire semaphore if not acquired in previous tries.


AcquireSemaphoreTaskInput

Initializer

import { AcquireSemaphoreTaskInput } from 'cdk-concurrency-controller'

const acquireSemaphoreTaskInput: AcquireSemaphoreTaskInput = { ... }

Properties

Name Type Description
limit string No description.
name string No description.
nextTryWaitTime string No description.
userId string No description.

limitRequired
public readonly limit: string;
  • Type: string

nameRequired
public readonly name: string;
  • Type: string

nextTryWaitTimeRequired
public readonly nextTryWaitTime: string;
  • Type: string

userIdRequired
public readonly userId: string;
  • Type: string

AcquireViaStartExecutionFragmentProps

Initializer

import { AcquireViaStartExecutionFragmentProps } from 'cdk-concurrency-controller'

const acquireViaStartExecutionFragmentProps: AcquireViaStartExecutionFragmentProps = { ... }

Properties

Name Type Description
taskTimeout aws-cdk-lib.aws_stepfunctions.Timeout Maximum run time for the execution.
timeout aws-cdk-lib.Duration Maximum run time for the execution.
input AcquireSemaphoreTaskInput No description.
stateMachine aws-cdk-lib.aws_stepfunctions.IStateMachine The Step Functions state machine to start the execution on.

taskTimeoutOptional
public readonly taskTimeout: Timeout;
  • Type: aws-cdk-lib.aws_stepfunctions.Timeout
  • Default: No timeout

Maximum run time for the execution.


timeoutOptional
  • Deprecated: Use taskTimeout instead
public readonly timeout: Duration;
  • Type: aws-cdk-lib.Duration
  • Default: No timeout

Maximum run time for the execution.


inputRequired
public readonly input: AcquireSemaphoreTaskInput;

stateMachineRequired
public readonly stateMachine: IStateMachine;
  • Type: aws-cdk-lib.aws_stepfunctions.IStateMachine

The Step Functions state machine to start the execution on.


DistributedSemaphoreProps

Initializer

import { DistributedSemaphoreProps } from 'cdk-concurrency-controller'

const distributedSemaphoreProps: DistributedSemaphoreProps = { ... }

Properties

Name Type Description
acquireSemaphoreStateMachineProps SemaphoreStateMachineProps No description.
cleanupSemaphoreStateMachineProps SemaphoreStateMachineProps No description.
defaultSemaphore SemaphoreDefinition The default semaphore settings.
releaseSemaphoreStateMachineProps SemaphoreStateMachineProps No description.
semaphores SemaphoreDefinition[] No description.

acquireSemaphoreStateMachinePropsOptional
public readonly acquireSemaphoreStateMachineProps: SemaphoreStateMachineProps;

cleanupSemaphoreStateMachinePropsOptional
public readonly cleanupSemaphoreStateMachineProps: SemaphoreStateMachineProps;

defaultSemaphoreOptional
public readonly defaultSemaphore: SemaphoreDefinition;

The default semaphore settings.

It is used when no other pattern of semaphore applied. This can be used as a quick start when working with a single arbitrary resource.

NOTE: the default semaphore name cannot use JsonPath expression for the sake of a safe fallback.


releaseSemaphoreStateMachinePropsOptional
public readonly releaseSemaphoreStateMachineProps: SemaphoreStateMachineProps;

semaphoresOptional
public readonly semaphores: SemaphoreDefinition[];

ReleaseOptions

Initializer

import { ReleaseOptions } from 'cdk-concurrency-controller'

const releaseOptions: ReleaseOptions = { ... }

Properties

Name Type Description
name string The name for the semaphore.
userId string The semaphore user id to acquire/release resource usage.
checkSemaphoreUseFirst boolean Check if the semaphore use exists before trying to release it.
taskTimeout aws-cdk-lib.aws_stepfunctions.Timeout Maximum run time for the execution.
timeout aws-cdk-lib.Duration Maximum run time for the execution.

nameRequired
public readonly name: string;
  • Type: string

The name for the semaphore.

Or it can be JsonPath expression that extracts the value from the state object at runtime. This allows custom semaphore names from runtime input for multiple resources.

Example value: $.semaphoreName


userIdRequired
public readonly userId: string;
  • Type: string

The semaphore user id to acquire/release resource usage.


checkSemaphoreUseFirstOptional
public readonly checkSemaphoreUseFirst: boolean;
  • Type: boolean
  • Default: false

Check if the semaphore use exists before trying to release it.

This can help to shift the load from write capacity to read capacity in case of missing semaphore use (best effort to avoid hot partitions and save write capacity for crucial actions), where DDB provides 3x throughput on read capacity than write capacity per partition. see more about hot partition: https://aws.amazon.com/premiumsupport/knowledge-center/dynamodb-table-throttled/#You_have_a_hot_partition_in_your_table


taskTimeoutOptional
public readonly taskTimeout: Timeout;
  • Type: aws-cdk-lib.aws_stepfunctions.Timeout
  • Default: No timeout

Maximum run time for the execution.


timeoutOptional
  • Deprecated: Use taskTimeout instead
public readonly timeout: Duration;
  • Type: aws-cdk-lib.Duration
  • Default: No timeout

Maximum run time for the execution.


ReleaseSemaphoreFragmentProps

Initializer

import { ReleaseSemaphoreFragmentProps } from 'cdk-concurrency-controller'

const releaseSemaphoreFragmentProps: ReleaseSemaphoreFragmentProps = { ... }

Properties

Name Type Description
name string The name for the semaphore.
userId string The semaphore user id to acquire/release resource usage.
checkSemaphoreUseFirst boolean Check if the semaphore use exists before trying to release it.
semaphoreTable SemaphoreTableDefinition The DynamoDB table to use for the semaphore.
retryStrategy aws-cdk-lib.aws_stepfunctions.RetryProps Retry strategy on Errors.ALL when releasing a semaphore use from the semaphore table.

nameRequired
public readonly name: string;
  • Type: string

The name for the semaphore.

Or it can be JsonPath expression that extracts the value from the state object at runtime. This allows custom semaphore names from runtime input for multiple resources.

Example value: $.semaphoreName


userIdRequired
public readonly userId: string;
  • Type: string

The semaphore user id to acquire/release resource usage.


checkSemaphoreUseFirstOptional
public readonly checkSemaphoreUseFirst: boolean;
  • Type: boolean
  • Default: false

Check if the semaphore use exists before trying to release it.

This can help to shift the load from write capacity to read capacity in case of missing semaphore use (best effort to avoid hot partitions and save write capacity for crucial actions), where DDB provides 3x throughput on read capacity than write capacity per partition. see more about hot partition: https://aws.amazon.com/premiumsupport/knowledge-center/dynamodb-table-throttled/#You_have_a_hot_partition_in_your_table


semaphoreTableRequired
public readonly semaphoreTable: SemaphoreTableDefinition;

The DynamoDB table to use for the semaphore.


retryStrategyOptional
public readonly retryStrategy: RetryProps;
  • Type: aws-cdk-lib.aws_stepfunctions.RetryProps
  • Default: '{ interval: Duration.seconds(1), maxAttempts: 5, backoffRate: 1.5 }'

Retry strategy on Errors.ALL when releasing a semaphore use from the semaphore table.

NOTE: errors property is always overridden to [Errors.ALL].


ReleaseSemaphoreOptions

Initializer

import { ReleaseSemaphoreOptions } from 'cdk-concurrency-controller'

const releaseSemaphoreOptions: ReleaseSemaphoreOptions = { ... }

Properties

Name Type Description
name string The name for the semaphore.
userId string The semaphore user id to acquire/release resource usage.
checkSemaphoreUseFirst boolean Check if the semaphore use exists before trying to release it.

nameRequired
public readonly name: string;
  • Type: string

The name for the semaphore.

Or it can be JsonPath expression that extracts the value from the state object at runtime. This allows custom semaphore names from runtime input for multiple resources.

Example value: $.semaphoreName


userIdRequired
public readonly userId: string;
  • Type: string

The semaphore user id to acquire/release resource usage.


checkSemaphoreUseFirstOptional
public readonly checkSemaphoreUseFirst: boolean;
  • Type: boolean
  • Default: false

Check if the semaphore use exists before trying to release it.

This can help to shift the load from write capacity to read capacity in case of missing semaphore use (best effort to avoid hot partitions and save write capacity for crucial actions), where DDB provides 3x throughput on read capacity than write capacity per partition. see more about hot partition: https://aws.amazon.com/premiumsupport/knowledge-center/dynamodb-table-throttled/#You_have_a_hot_partition_in_your_table


ReleaseSemaphoreTaskInput

Initializer

import { ReleaseSemaphoreTaskInput } from 'cdk-concurrency-controller'

const releaseSemaphoreTaskInput: ReleaseSemaphoreTaskInput = { ... }

Properties

Name Type Description
name string No description.
userId string No description.

nameRequired
public readonly name: string;
  • Type: string

userIdRequired
public readonly userId: string;
  • Type: string

ReleaseViaStartExecutionFragmentProps

Initializer

import { ReleaseViaStartExecutionFragmentProps } from 'cdk-concurrency-controller'

const releaseViaStartExecutionFragmentProps: ReleaseViaStartExecutionFragmentProps = { ... }

Properties

Name Type Description
taskTimeout aws-cdk-lib.aws_stepfunctions.Timeout Maximum run time for the execution.
timeout aws-cdk-lib.Duration Maximum run time for the execution.
input ReleaseSemaphoreTaskInput No description.
stateMachine aws-cdk-lib.aws_stepfunctions.IStateMachine The Step Functions state machine to start the execution on.

taskTimeoutOptional
public readonly taskTimeout: Timeout;
  • Type: aws-cdk-lib.aws_stepfunctions.Timeout
  • Default: No timeout

Maximum run time for the execution.


timeoutOptional
  • Deprecated: Use taskTimeout instead
public readonly timeout: Duration;
  • Type: aws-cdk-lib.Duration
  • Default: No timeout

Maximum run time for the execution.


inputRequired
public readonly input: ReleaseSemaphoreTaskInput;

stateMachineRequired
public readonly stateMachine: IStateMachine;
  • Type: aws-cdk-lib.aws_stepfunctions.IStateMachine

The Step Functions state machine to start the execution on.


SemaphoreDefinition

Initializer

import { SemaphoreDefinition } from 'cdk-concurrency-controller'

const semaphoreDefinition: SemaphoreDefinition = { ... }

Properties

Name Type Description
limit string The value for concurrency control.
name string The name for the semaphore.

limitRequired
public readonly limit: string;
  • Type: string

The value for concurrency control.


nameRequired
public readonly name: string;
  • Type: string

The name for the semaphore.

Or it can be JsonPath expression that extracts the value from the state object at runtime. This allows custom semaphore names from runtime input for multiple resources.

Example value: $.semaphoreName


SemaphoreStateMachineProps

Initializer

import { SemaphoreStateMachineProps } from 'cdk-concurrency-controller'

const semaphoreStateMachineProps: SemaphoreStateMachineProps = { ... }

Properties

Name Type Description
taskTimeout aws-cdk-lib.aws_stepfunctions.Timeout Maximum run time for the execution.
timeout aws-cdk-lib.Duration Maximum run time for the execution.
logs aws-cdk-lib.aws_stepfunctions.LogOptions Defines what execution history events are logged and where they are logged.
tracingEnabled boolean Specifies whether Amazon X-Ray tracing is enabled for this state machine.

taskTimeoutOptional
public readonly taskTimeout: Timeout;
  • Type: aws-cdk-lib.aws_stepfunctions.Timeout
  • Default: No timeout

Maximum run time for the execution.


timeoutOptional
  • Deprecated: Use taskTimeout instead
public readonly timeout: Duration;
  • Type: aws-cdk-lib.Duration
  • Default: No timeout

Maximum run time for the execution.


logsOptional
public readonly logs: LogOptions;
  • Type: aws-cdk-lib.aws_stepfunctions.LogOptions
  • Default: No logging

Defines what execution history events are logged and where they are logged.


tracingEnabledOptional
public readonly tracingEnabled: boolean;
  • Type: boolean
  • Default: false

Specifies whether Amazon X-Ray tracing is enabled for this state machine.


SemaphoreTableDefinition

Initializer

import { SemaphoreTableDefinition } from 'cdk-concurrency-controller'

const semaphoreTableDefinition: SemaphoreTableDefinition = { ... }

Properties

Name Type Description
countAttributeName string The attribute name for a semaphore in-use count.
partitionKey aws-cdk-lib.aws_dynamodb.Attribute No description.
table aws-cdk-lib.aws_dynamodb.ITable No description.

countAttributeNameRequired
public readonly countAttributeName: string;
  • Type: string

The attribute name for a semaphore in-use count.


partitionKeyRequired
public readonly partitionKey: Attribute;
  • Type: aws-cdk-lib.aws_dynamodb.Attribute

tableRequired
public readonly table: ITable;
  • Type: aws-cdk-lib.aws_dynamodb.ITable

SemaphoreTimeoutOptions

Initializer

import { SemaphoreTimeoutOptions } from 'cdk-concurrency-controller'

const semaphoreTimeoutOptions: SemaphoreTimeoutOptions = { ... }

Properties

Name Type Description
taskTimeout aws-cdk-lib.aws_stepfunctions.Timeout Maximum run time for the execution.
timeout aws-cdk-lib.Duration Maximum run time for the execution.

taskTimeoutOptional
public readonly taskTimeout: Timeout;
  • Type: aws-cdk-lib.aws_stepfunctions.Timeout
  • Default: No timeout

Maximum run time for the execution.


timeoutOptional
  • Deprecated: Use taskTimeout instead
public readonly timeout: Duration;
  • Type: aws-cdk-lib.Duration
  • Default: No timeout

Maximum run time for the execution.


SemaphoreUseDefinition

Initializer

import { SemaphoreUseDefinition } from 'cdk-concurrency-controller'

const semaphoreUseDefinition: SemaphoreUseDefinition = { ... }

Properties

Name Type Description
name string The name for the semaphore.
userId string The semaphore user id to acquire/release resource usage.

nameRequired
public readonly name: string;
  • Type: string

The name for the semaphore.

Or it can be JsonPath expression that extracts the value from the state object at runtime. This allows custom semaphore names from runtime input for multiple resources.

Example value: $.semaphoreName


userIdRequired
public readonly userId: string;
  • Type: string

The semaphore user id to acquire/release resource usage.