interface Credentials
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.StepFunctions.Credentials |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsstepfunctions#Credentials |
Java | software.amazon.awscdk.services.stepfunctions.Credentials |
Python | aws_cdk.aws_stepfunctions.Credentials |
TypeScript (source) | aws-cdk-lib » aws_stepfunctions » Credentials |
Specifies a target role assumed by the State Machine's execution role for invoking the task's resource.
Example
import * as lambda from 'aws-cdk-lib/aws-lambda';
declare const submitLambda: lambda.Function;
declare const iamRole: iam.Role;
// use a fixed role for all task invocations
const role = sfn.TaskRole.fromRole(iamRole);
// or use a json expression to resolve the role at runtime based on task inputs
//const role = sfn.TaskRole.fromRoleArnJsonPath('$.RoleArn');
const submitJob = new tasks.LambdaInvoke(this, 'Submit Job', {
lambdaFunction: submitLambda,
outputPath: '$.Payload',
// use credentials
credentials: { role },
});
Properties
Name | Type | Description |
---|---|---|
role | Task | The role to be assumed for executing the Task. |
role
Type:
Task
The role to be assumed for executing the Task.