UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 5.47 kB
"use strict";var _a,_b;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=require("../../../aws-iam");return iam=()=>tmp,tmp},sfn=()=>{var tmp=require("../../../aws-stepfunctions");return sfn=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},task_utils_1=()=>{var tmp=require("../private/task-utils");return task_utils_1=()=>tmp,tmp};class GlueStartJobRun extends sfn().TaskStateBase{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})}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 Error("You cannot set both 'workerType' and 'workerTypeV2' properties in 'workerConfiguration'.");if(!workerConfiguration.workerTypeV2&&!workerConfiguration.workerType)throw new Error("You must set either 'workerType' or 'workerTypeV2' property in 'workerConfiguration'.")}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,_a=JSII_RTTI_SYMBOL_1,GlueStartJobRun[_a]={fqn:"aws-cdk-lib.aws_stepfunctions_tasks.GlueStartJobRun",version:"2.185.0"},GlueStartJobRun.SUPPORTED_INTEGRATION_PATTERNS=[sfn().IntegrationPattern.REQUEST_RESPONSE,sfn().IntegrationPattern.RUN_JOB];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 of(workerType){return new WorkerTypeV2(workerType)}constructor(name){this.name=name}}exports.WorkerTypeV2=WorkerTypeV2,_b=JSII_RTTI_SYMBOL_1,WorkerTypeV2[_b]={fqn:"aws-cdk-lib.aws_stepfunctions_tasks.WorkerTypeV2",version:"2.185.0"},WorkerTypeV2.STANDARD=new WorkerTypeV2("Standard"),WorkerTypeV2.G_1X=new WorkerTypeV2("G.1X"),WorkerTypeV2.G_2X=new WorkerTypeV2("G.2X"),WorkerTypeV2.G_4X=new WorkerTypeV2("G.4X"),WorkerTypeV2.G_8X=new WorkerTypeV2("G.8X"),WorkerTypeV2.G_025X=new WorkerTypeV2("G.025X"),WorkerTypeV2.Z_2X=new WorkerTypeV2("Z.2X");var ExecutionClass;(function(ExecutionClass2){ExecutionClass2.FLEX="FLEX",ExecutionClass2.STANDARD="STANDARD"})(ExecutionClass||(exports.ExecutionClass=ExecutionClass={}));