aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 6.8 kB
JavaScript
;var __createBinding=exports&&exports.__createBinding||(Object.create?(function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}):(function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]})),__setModuleDefault=exports&&exports.__setModuleDefault||(Object.create?(function(o,v){Object.defineProperty(o,"default",{enumerable:!0,value:v})}):function(o,v){o.default=v}),__importStar=exports&&exports.__importStar||(function(){var ownKeys=function(o){return ownKeys=Object.getOwnPropertyNames||function(o2){var ar=[];for(var k in o2)Object.prototype.hasOwnProperty.call(o2,k)&&(ar[ar.length]=k);return ar},ownKeys(o)};return function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k=ownKeys(mod),i=0;i<k.length;i++)k[i]!=="default"&&__createBinding(result,mod,k[i]);return __setModuleDefault(result,mod),result}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.ExecutionClass=exports.WorkerTypeV2=exports.WorkerType=exports.GlueStartJobRun=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var iam=()=>{var tmp=__importStar(require("../../../aws-iam"));return iam=()=>tmp,tmp},sfn=()=>{var tmp=__importStar(require("../../../aws-stepfunctions"));return sfn=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp},task_utils_1=()=>{var tmp=require("../private/task-utils");return task_utils_1=()=>tmp,tmp};class GlueStartJobRun extends sfn().TaskStateBase{props;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions_tasks.GlueStartJobRun",version:"2.260.0"};static jsonPath(scope,id,props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_tasks_GlueStartJobRunJsonPathProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.jsonPath),error}return new GlueStartJobRun(scope,id,props)}static jsonata(scope,id,props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_tasks_GlueStartJobRunJsonataProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.jsonata),error}return new GlueStartJobRun(scope,id,{...props,queryLanguage:sfn().QueryLanguage.JSONATA})}static SUPPORTED_INTEGRATION_PATTERNS=[sfn().IntegrationPattern.REQUEST_RESPONSE,sfn().IntegrationPattern.RUN_JOB];taskMetrics;taskPolicies;integrationPattern;jobArguments;constructor(scope,id,props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_tasks_GlueStartJobRunProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,GlueStartJobRun),error}const superProps={...props,arguments:void 0};super(scope,id,superProps),this.props=props,this.jobArguments=props.arguments,this.integrationPattern=props.integrationPattern??sfn().IntegrationPattern.REQUEST_RESPONSE,(0,task_utils_1().validatePatternSupported)(this.integrationPattern,GlueStartJobRun.SUPPORTED_INTEGRATION_PATTERNS),this.taskPolicies=this.getPolicies(),this.taskMetrics={metricPrefixSingular:"GlueJob",metricPrefixPlural:"GlueJobs",metricDimensions:{GlueJobName:this.props.glueJobName}}}_renderTask(topLevelQueryLanguage){const queryLanguage=sfn()._getActualQueryLanguage(topLevelQueryLanguage,this.props.queryLanguage),notificationProperty=this.props.notifyDelayAfter?{NotifyDelayAfter:this.props.notifyDelayAfter.toMinutes()}:null;let timeout;if(this.props.timeout?timeout=this.props.timeout.toMinutes():this.props.taskTimeout?.seconds?timeout=core_1().Duration.seconds(this.props.taskTimeout.seconds).toMinutes():this.props.taskTimeout?.path&&(timeout=sfn().JsonPath.numberAt(this.props.taskTimeout.path)),this.props.workerConfiguration){const workerConfiguration=this.props.workerConfiguration;if(workerConfiguration?.workerTypeV2&&workerConfiguration.workerType)throw new(core_1()).ValidationError((0,literal_string_1().lit)`CannotSetBothWorkerTypeAndWorkerTypeV2`,"You cannot set both 'workerType' and 'workerTypeV2' properties in 'workerConfiguration'.",this);if(!workerConfiguration.workerTypeV2&&!workerConfiguration.workerType)throw new(core_1()).ValidationError((0,literal_string_1().lit)`EitherWorkerTypeOrWorkerTypeV2Required`,"You must set either 'workerType' or 'workerTypeV2' property in 'workerConfiguration'.",this)}const workerType=this.props.workerConfiguration?.workerType??this.props.workerConfiguration?.workerTypeV2?.name;return{Resource:(0,task_utils_1().integrationResourceArn)("glue","startJobRun",this.integrationPattern),...this._renderParametersOrArguments({JobName:this.props.glueJobName,Arguments:this.jobArguments?.value,Timeout:timeout,SecurityConfiguration:this.props.securityConfiguration,NotificationProperty:notificationProperty,WorkerType:workerType,NumberOfWorkers:this.props.workerConfiguration?.numberOfWorkers,ExecutionClass:this.props.executionClass},queryLanguage),TimeoutSeconds:void 0,TimeoutSecondsPath:void 0}}getPolicies(){let iamActions;return this.integrationPattern===sfn().IntegrationPattern.REQUEST_RESPONSE?iamActions=["glue:StartJobRun"]:this.integrationPattern===sfn().IntegrationPattern.RUN_JOB&&(iamActions=["glue:StartJobRun","glue:GetJobRun","glue:GetJobRuns","glue:BatchStopJobRun"]),[new(iam()).PolicyStatement({resources:[core_1().Stack.of(this).formatArn({service:"glue",resource:"job",resourceName:this.props.glueJobName})],actions:iamActions})]}}exports.GlueStartJobRun=GlueStartJobRun;var WorkerType;(function(WorkerType2){WorkerType2.STANDARD="Standard",WorkerType2.G_025X="G.025X",WorkerType2.G_1X="G.1X",WorkerType2.G_2X="G.2X",WorkerType2.G_4X="G.4X",WorkerType2.G_8X="G.8X",WorkerType2.Z_2X="Z.2X"})(WorkerType||(exports.WorkerType=WorkerType={}));class WorkerTypeV2{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions_tasks.WorkerTypeV2",version:"2.260.0"};static STANDARD=new WorkerTypeV2("Standard");static G_1X=new WorkerTypeV2("G.1X");static G_2X=new WorkerTypeV2("G.2X");static G_4X=new WorkerTypeV2("G.4X");static G_8X=new WorkerTypeV2("G.8X");static G_025X=new WorkerTypeV2("G.025X");static Z_2X=new WorkerTypeV2("Z.2X");static of(workerType){return new WorkerTypeV2(workerType)}name;constructor(name){this.name=name}}exports.WorkerTypeV2=WorkerTypeV2;var ExecutionClass;(function(ExecutionClass2){ExecutionClass2.FLEX="FLEX",ExecutionClass2.STANDARD="STANDARD"})(ExecutionClass||(exports.ExecutionClass=ExecutionClass={}));