Class CallAwsServiceProps
Properties for calling an AWS service's API action from your state machine.
Inheritance
Namespace: Amazon.CDK.AWS.StepFunctions.Tasks
Assembly: Amazon.CDK.AWS.StepFunctions.Tasks.dll
Syntax (csharp)
public class CallAwsServiceProps : Object, ICallAwsServiceProps, ITaskStateBaseProps
Syntax (vb)
Public Class CallAwsServiceProps
Inherits Object
Implements ICallAwsServiceProps, ITaskStateBaseProps
Remarks
See: https://docs.aws.amazon.com/step-functions/latest/dg/supported-services-awssdk.html
ExampleMetadata: infused
Examples
Bucket myBucket;
var getObject = new CallAwsService(this, "GetObject", new CallAwsServiceProps {
Service = "s3",
Action = "getObject",
Parameters = new Dictionary<string, object> {
{ "Bucket", myBucket.BucketName },
{ "Key", JsonPath.StringAt("$.key") }
},
IamResources = new [] { myBucket.ArnForObjects("*") }
});
Synopsis
Constructors
CallAwsServiceProps() |
Properties
Action | The API action to call. |
Comment | An optional description for this state. |
Heartbeat | Timeout for the heartbeat. |
IamAction | The action for the IAM statement that will be added to the state machine role's policy to allow the state machine to make the API call. |
IamResources | The resources for the IAM statement that will be added to the state machine role's policy to allow the state machine to make the API call. |
InputPath | JSONPath expression to select part of the state to be the input to this state. |
IntegrationPattern | AWS Step Functions integrates with services directly in the Amazon States Language. |
OutputPath | JSONPath expression to select select a portion of the state output to pass to the next state. |
Parameters | Parameters for the API action call. |
ResultPath | JSONPath expression to indicate where to inject the state's output. |
ResultSelector | The JSON that will replace the state's raw result and become the effective result before ResultPath is applied. |
Service | The AWS service to call. |
Timeout | Timeout for the state machine. |
Constructors
CallAwsServiceProps()
public CallAwsServiceProps()
Properties
Action
The API action to call.
public string Action { get; set; }
Property Value
System.String
Remarks
Use camelCase.
Comment
An optional description for this state.
public string Comment { get; set; }
Property Value
System.String
Remarks
Default: - No comment
Heartbeat
Timeout for the heartbeat.
public Duration Heartbeat { get; set; }
Property Value
Remarks
Default: - None
IamAction
The action for the IAM statement that will be added to the state machine role's policy to allow the state machine to make the API call.
public string IamAction { get; set; }
Property Value
System.String
Remarks
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
.
Default: - service:action
IamResources
The resources for the IAM statement that will be added to the state machine role's policy to allow the state machine to make the API call.
public string[] IamResources { get; set; }
Property Value
System.String[]
Remarks
By default the action for this IAM statement will be service:action
.
InputPath
JSONPath expression to select part of the state to be the input to this state.
public string InputPath { get; set; }
Property Value
System.String
Remarks
May also be the special value JsonPath.DISCARD, which will cause the effective input to be the empty object {}.
Default: - The entire task input (JSON path '$')
IntegrationPattern
AWS Step Functions integrates with services directly in the Amazon States Language.
public Nullable<IntegrationPattern> IntegrationPattern { get; set; }
Property Value
System.Nullable<IntegrationPattern>
Remarks
You can control these AWS services using service integration patterns
Default: - IntegrationPattern.REQUEST_RESPONSE
for most tasks.
IntegrationPattern.RUN_JOB
for the following exceptions:
BatchSubmitJob
, EmrAddStep
, EmrCreateCluster
, EmrTerminationCluster
, and EmrContainersStartJobRun
.
See: https://docs.aws.amazon.com/step-functions/latest/dg/connect-to-resource.html#connect-wait-token
OutputPath
JSONPath expression to select select a portion of the state output to pass to the next state.
public string OutputPath { get; set; }
Property Value
System.String
Remarks
May also be the special value JsonPath.DISCARD, which will cause the effective output to be the empty object {}.
Default: - The entire JSON node determined by the state input, the task result, and resultPath is passed to the next state (JSON path '$')
Parameters
Parameters for the API action call.
public IDictionary<string, object> Parameters { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Remarks
Use PascalCase for the parameter names.
Default: - no parameters
ResultPath
JSONPath expression to indicate where to inject the state's output.
public string ResultPath { get; set; }
Property Value
System.String
Remarks
May also be the special value JsonPath.DISCARD, which will cause the state's input to become its output.
Default: - Replaces the entire input with the result (JSON path '$')
ResultSelector
The JSON that will replace the state's raw result and become the effective result before ResultPath is applied.
public IDictionary<string, object> ResultSelector { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Remarks
You can use ResultSelector to create a payload with values that are static or selected from the state's raw result.
Default: - None
Service
The AWS service to call.
public string Service { get; set; }
Property Value
System.String
Remarks
Timeout
Timeout for the state machine.
public Duration Timeout { get; set; }
Property Value
Remarks
Default: - None