Show / Hide Table of Contents

Class TaskRole

Role to be assumed by the State Machine's execution role for invoking a task's resource.

Inheritance
object
TaskRole
Namespace: Amazon.CDK.AWS.StepFunctions
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public abstract class TaskRole : DeputyBase
Syntax (vb)
Public MustInherit Class TaskRole Inherits DeputyBase
Remarks

See: https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-task-state.html#task-state-fields

ExampleMetadata: infused

Examples
using Amazon.CDK.AWS.Lambda;

             Function submitLambda;
             Role iamRole;


             // use a fixed role for all task invocations
             var role = TaskRole.FromRole(iamRole);
             // or use a json expression to resolve the role at runtime based on task inputs
             //const role = sfn.TaskRole.fromRoleArnJsonPath('$.RoleArn');

             var submitJob = new LambdaInvoke(this, "Submit Job", new LambdaInvokeProps {
                 LambdaFunction = submitLambda,
                 OutputPath = "$.Payload",
                 // use credentials
                 Credentials = new Credentials { Role = role }
             });

Synopsis

Constructors

TaskRole()

Role to be assumed by the State Machine's execution role for invoking a task's resource.

Properties

Resource

Retrieves the resource for use in IAM Policies for this TaskRole.

RoleArn

Retrieves the roleArn for this TaskRole.

Methods

FromRole(IRole)

Construct a task role based on the provided IAM Role.

FromRoleArnJsonPath(string)

Construct a task role retrieved from task inputs using a json expression.

Constructors

TaskRole()

Role to be assumed by the State Machine's execution role for invoking a task's resource.

protected TaskRole()
Remarks

See: https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-task-state.html#task-state-fields

ExampleMetadata: infused

Examples
using Amazon.CDK.AWS.Lambda;

             Function submitLambda;
             Role iamRole;


             // use a fixed role for all task invocations
             var role = TaskRole.FromRole(iamRole);
             // or use a json expression to resolve the role at runtime based on task inputs
             //const role = sfn.TaskRole.fromRoleArnJsonPath('$.RoleArn');

             var submitJob = new LambdaInvoke(this, "Submit Job", new LambdaInvokeProps {
                 LambdaFunction = submitLambda,
                 OutputPath = "$.Payload",
                 // use credentials
                 Credentials = new Credentials { Role = role }
             });

Properties

Resource

Retrieves the resource for use in IAM Policies for this TaskRole.

public abstract string Resource { get; }
Property Value

string

Remarks

See: https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-task-state.html#task-state-fields

ExampleMetadata: infused

RoleArn

Retrieves the roleArn for this TaskRole.

public abstract string RoleArn { get; }
Property Value

string

Remarks

See: https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-task-state.html#task-state-fields

ExampleMetadata: infused

Methods

FromRole(IRole)

Construct a task role based on the provided IAM Role.

public static TaskRole FromRole(IRole role)
Parameters
role IRole

IAM Role.

Returns

TaskRole

Remarks

See: https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-task-state.html#task-state-fields

ExampleMetadata: infused

FromRoleArnJsonPath(string)

Construct a task role retrieved from task inputs using a json expression.

public static TaskRole FromRoleArnJsonPath(string expression)
Parameters
expression string

json expression to roleArn.

Returns

TaskRole

Remarks

See: https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-task-state.html#task-state-fields

ExampleMetadata: infused

Examples
TaskRole.FromRoleArnJsonPath("$.RoleArn");
Back to top Generated by DocFX