CallAwsServiceCrossRegionJsonPathProps Struct
Properties for calling an AWS service's API action using JSONPath from your state machine across regions.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';
import { aws_stepfunctions as stepfunctions } from 'aws-cdk-lib';
import { aws_stepfunctions_tasks as stepfunctions_tasks } from 'aws-cdk-lib';
declare const assign: any;
declare const parameters: any;
declare const policyStatement: iam.PolicyStatement;
declare const resultSelector: any;
declare const taskRole: stepfunctions.TaskRole;
declare const timeout: stepfunctions.Timeout;
const callAwsServiceCrossRegionJsonPathProps: stepfunctions_tasks.CallAwsServiceCrossRegionJsonPathProps = {
action: 'action',
iamResources: ['iamResources'],
region: 'region',
service: 'service',
// the properties below are optional
additionalIamStatements: [policyStatement],
assign: {
assignKey: assign,
},
comment: 'comment',
credentials: {
role: taskRole,
},
endpoint: 'endpoint',
heartbeat: cdk.Duration.minutes(30),
heartbeatTimeout: timeout,
iamAction: 'iamAction',
inputPath: 'inputPath',
integrationPattern: stepfunctions.IntegrationPattern.REQUEST_RESPONSE,
outputPath: 'outputPath',
parameters: {
parametersKey: parameters,
},
queryLanguage: stepfunctions.QueryLanguage.JSON_PATH,
resultPath: 'resultPath',
resultSelector: {
resultSelectorKey: resultSelector,
},
retryOnServiceExceptions: false,
stateName: 'stateName',
taskTimeout: timeout,
timeout: cdk.Duration.minutes(30),
};
Properties
Use camelCase.
additionalIamStatementsPolicyStatement[]additional_iam_statementstyping.List[PolicyStatement]additionalIamStatementsList<PolicyStatement>AdditionalIamStatementsPolicyStatement[]AdditionalIamStatements*[]PolicyStatement= no additional statements are add…#Use in the case where the call requires more than a single statement to be executed, e.g. rekognition:detectLabels requires also S3 permissions to read the object on which it must act.
default
Default: no additional statements are added
assign{ [key: string]: any }assigntyping.Mapping[str, Any]assignMap<String, Object>AssignIDictionary<string, object>Assign*map[string]interface{}= Not assign variables#Using workflow variables, you can store data in a step and retrieve that data in future steps.
credentialsCredentialscredentialsCredentialscredentialsCredentialsCredentialsCredentialsCredentialsCredentials= None (Task is executed using the…#This enables cross-account resource invocations.
default
Default: None (Task is executed using the State Machine's execution role)
endpointstringendpointstrendpointStringEndpointstringEndpoint*string= Do not override API endpoint.#notes
Be aware that if you set this to a value from the Step Functions state (e.g. sfn.JsonPath.stringAt('$.endpoint')), the endpoint is controlled at runtime by whoever can start the state machine execution. This could allow them to redirect the authenticated AWS API call to a server they control, allowing them to intercept and replay that specific API call.
heartbeatDurationheartbeatDurationheartbeatDurationHeartbeatDurationHeartbeatDuration= Nonedeprecated#heartbeatTimeoutTimeoutheartbeat_timeoutTimeoutheartbeatTimeoutTimeoutHeartbeatTimeoutTimeoutHeartbeatTimeoutTimeout= None#[disable-awslint:duration-prop-type] is needed because all props interface in aws-stepfunctions-tasks extend this interface
By default the action for this IAM statement will be service:action.
Use in the case where the IAM action name does not match with the API service/action name, e.g. s3:ListBuckets requires s3:ListAllMyBuckets.
iamResourcesstring[]iam_resourcestyping.List[str]iamResourcesList<String>IamResourcesstring[]IamResources*[]*stringrequired#May also be the special value JsonPath.DISCARD, which will cause the effective input to be the empty object {}.
integrationPatternIntegrationPatternintegration_patternIntegrationPatternintegrationPatternIntegrationPatternIntegrationPatternIntegrationPatternIntegrationPatternIntegrationPattern= `IntegrationPattern.REQUEST_RESP…#You can control these AWS services using service integration patterns.
Depending on the AWS Service, the Service Integration Pattern availability will vary.
default
Default: IntegrationPattern.REQUEST_RESPONSE for most tasks. IntegrationPattern.RUN_JOB for the following exceptions: BatchSubmitJob, EmrAddStep, EmrCreateCluster, EmrTerminationCluster, and EmrContainersStartJobRun.
May also be the special value JsonPath.DISCARD, which will cause the effective output to be the empty object {}.
parameters{ [key: string]: any }parameterstyping.Mapping[str, Any]parametersMap<String, Object>ParametersIDictionary<string, object>Parameters*map[string]interface{}= no parameters#queryLanguageQueryLanguagequery_languageQueryLanguagequeryLanguageQueryLanguageQueryLanguageQueryLanguageQueryLanguageQueryLanguage= JSONPath#If the state does not contain a queryLanguage field, then it will use the query language specified in the top-level queryLanguage field.
example
'us-east-1'
May also be the special value JsonPath.DISCARD, which will cause the state's input to become its output.
resultSelector{ [key: string]: any }result_selectortyping.Mapping[str, Any]resultSelectorMap<String, Object>ResultSelectorIDictionary<string, object>ResultSelector*map[string]interface{}= None#You can use ResultSelector to create a payload with values that are static or selected from the state's raw result.
retryOnServiceExceptionsbooleanretry_on_service_exceptionsboolretryOnServiceExceptionsBooleanRetryOnServiceExceptionsboolRetryOnServiceExceptions*bool= true#This handles Lambda.ServiceException, Lambda.AWSLambdaException, Lambda.SdkClientException, and Lambda.ClientExecutionTimeoutException with an interval of 2 seconds, a back-off rate of 2 and 6 maximum attempts.
example
's3'
stateNamestringstate_namestrstateNameStringStateNamestringStateName*string= The construct ID will be used as…#default
Default: The construct ID will be used as state name
[disable-awslint:duration-prop-type] is needed because all props interface in aws-stepfunctions-tasks extend this interface