TaskRole
- class aws_cdk.aws_stepfunctions.TaskRole
Bases:
object
Role to be assumed by the State Machine’s execution role for invoking a task’s resource.
- See:
- ExampleMetadata:
infused
Example:
import aws_cdk.aws_lambda as lambda_ # submit_lambda: lambda.Function # iam_role: iam.Role # use a fixed role for all task invocations role = sfn.TaskRole.from_role(iam_role) # or use a json expression to resolve the role at runtime based on task inputs # const role = sfn.TaskRole.fromRoleArnJsonPath('$.RoleArn'); submit_job = tasks.LambdaInvoke(self, "Submit Job", lambda_function=submit_lambda, output_path="$.Payload", # use credentials credentials=sfn.Credentials(role=role) )
Attributes
- resource
Retrieves the resource for use in IAM Policies for this TaskRole.
- role_arn
Retrieves the roleArn for this TaskRole.
Static Methods
- classmethod from_role(role)
Construct a task role based on the provided IAM Role.