UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 1.34 kB
"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.SfnStateMachine=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),util_1=require("./util");class SfnStateMachine{constructor(machine,props={}){this.machine=machine,this.props=props;try{jsiiDeprecationWarnings.aws_cdk_lib_aws_stepfunctions_IStateMachine(machine),jsiiDeprecationWarnings.aws_cdk_lib_aws_events_targets_SfnStateMachineProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,SfnStateMachine),error}this.role=props.role??util_1.singletonEventRole(machine),machine.grantStartExecution(this.role)}bind(_rule,_id){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_events_IRule(_rule)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bind),error}return this.props.deadLetterQueue&&util_1.addToDeadLetterQueueResourcePolicy(_rule,this.props.deadLetterQueue),{...util_1.bindBaseTargetConfig(this.props),arn:this.machine.stateMachineArn,role:this.role,input:this.props.input,targetResource:this.machine}}}exports.SfnStateMachine=SfnStateMachine,_a=JSII_RTTI_SYMBOL_1,SfnStateMachine[_a]={fqn:"aws-cdk-lib.aws_events_targets.SfnStateMachine",version:"2.70.0"};