UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 1.22 kB
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.integrationResourceArn=exports.validatePatternSupported=void 0;var aws_stepfunctions_1=()=>{var tmp=require("../../../aws-stepfunctions");return aws_stepfunctions_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp};function validatePatternSupported(integrationPattern,supportedPatterns){if(!supportedPatterns.includes(integrationPattern))throw new Error(`Unsupported service integration pattern. Supported Patterns: ${supportedPatterns}. Received: ${integrationPattern}`)}exports.validatePatternSupported=validatePatternSupported;const resourceArnSuffix={[aws_stepfunctions_1().IntegrationPattern.REQUEST_RESPONSE]:"",[aws_stepfunctions_1().IntegrationPattern.RUN_JOB]:".sync",[aws_stepfunctions_1().IntegrationPattern.WAIT_FOR_TASK_TOKEN]:".waitForTaskToken"};function integrationResourceArn(service,api,integrationPattern){if(!service||!api)throw new Error("Both 'service' and 'api' must be provided to build the resource ARN.");return`arn:${core_1().Aws.PARTITION}:states:::${service}:${api}`+(integrationPattern?resourceArnSuffix[integrationPattern]:"")}exports.integrationResourceArn=integrationResourceArn;