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.
additionalIamStatementsoptionalPolicyStatement[]additional_iam_statementsoptionaltyping.List[PolicyStatement]additionalIamStatementsoptionalList<PolicyStatement>AdditionalIamStatementsoptionalPolicyStatement[]AdditionalIamStatementsoptional*[]PolicyStatement#Default: no additional statements are added
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.
assignoptional{ [key: string]: any }assignoptionaltyping.Mapping[str, Any]assignoptionalMap<String, Object>AssignoptionalIDictionary<string, object>Assignoptional*map[string]interface{}#Default: Not assign variables
Using workflow variables, you can store data in a step and retrieve that data in future steps.
commentoptionalstringcommentoptionalstrcommentoptionalStringCommentoptionalstringCommentoptional*string#Default: No comment
credentialsoptionalCredentialscredentialsoptionalCredentialscredentialsoptionalCredentialsCredentialsoptionalCredentialsCredentialsoptionalCredentials#Default: None (Task is executed using the State Machine's execution role)
This enables cross-account resource invocations.
endpointoptionalstringendpointoptionalstrendpointoptionalStringEndpointoptionalstringEndpointoptional*string#Default: 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.
heartbeatoptionalDurationheartbeatoptionalDurationheartbeatoptionalDurationHeartbeatoptionalDurationHeartbeatoptionalDuration= Nonedeprecated#heartbeatTimeoutoptionalTimeoutheartbeat_timeoutoptionalTimeoutheartbeatTimeoutoptionalTimeoutHeartbeatTimeoutoptionalTimeoutHeartbeatTimeoutoptionalTimeout= None#[disable-awslint:duration-prop-type] is needed because all props interface in aws-stepfunctions-tasks extend this interface
iamActionoptionalstringiam_actionoptionalstriamActionoptionalStringIamActionoptionalstringIamActionoptional*string= service:action#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#inputPathoptionalstringinput_pathoptionalstrinputPathoptionalStringInputPathoptionalstringInputPathoptional*string= $#May also be the special value JsonPath.DISCARD, which will cause the effective input to be the empty object {}.
integrationPatternoptionalIntegrationPatternintegration_patternoptionalIntegrationPatternintegrationPatternoptionalIntegrationPatternIntegrationPatternoptionalIntegrationPatternIntegrationPatternoptionalIntegrationPattern#Default: IntegrationPattern.REQUEST_RESPONSE for most tasks. IntegrationPattern.RUN_JOB for the following exceptions: BatchSubmitJob, EmrAddStep, EmrCreateCluster, EmrTerminationCluster, and EmrContainersStartJobRun.
You can control these AWS services using service integration patterns.
Depending on the AWS Service, the Service Integration Pattern availability will vary.
outputPathoptionalstringoutput_pathoptionalstroutputPathoptionalStringOutputPathoptionalstringOutputPathoptional*string= $#May also be the special value JsonPath.DISCARD, which will cause the effective output to be the empty object {}.
parametersoptional{ [key: string]: any }parametersoptionaltyping.Mapping[str, Any]parametersoptionalMap<String, Object>ParametersoptionalIDictionary<string, object>Parametersoptional*map[string]interface{}#Default: no parameters
queryLanguageoptionalQueryLanguagequery_languageoptionalQueryLanguagequeryLanguageoptionalQueryLanguageQueryLanguageoptionalQueryLanguageQueryLanguageoptionalQueryLanguage= 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'
resultPathoptionalstringresult_pathoptionalstrresultPathoptionalStringResultPathoptionalstringResultPathoptional*string= $#May also be the special value JsonPath.DISCARD, which will cause the state's input to become its output.
resultSelectoroptional{ [key: string]: any }result_selectoroptionaltyping.Mapping[str, Any]resultSelectoroptionalMap<String, Object>ResultSelectoroptionalIDictionary<string, object>ResultSelectoroptional*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.
retryOnServiceExceptionsoptionalbooleanretry_on_service_exceptionsoptionalboolretryOnServiceExceptionsoptionalBooleanRetryOnServiceExceptionsoptionalboolRetryOnServiceExceptionsoptional*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'
stateNameoptionalstringstate_nameoptionalstrstateNameoptionalStringStateNameoptionalstringStateNameoptional*string#Default: The construct ID will be used as state name