Class TaskRole
Role to be assumed by the State Machine's execution role for invoking a task's resource.
Inheritance
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
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
Task |
|
Task |
Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Task |
Used by jsii to construct an instance of this class from DeputyProps |
Properties
Resource | Retrieves the resource for use in IAM Policies for this TaskRole. |
Role |
Retrieves the roleArn for this TaskRole. |
Methods
From |
Construct a task role based on the provided IAM Role. |
From |
Construct a task role retrieved from task inputs using a json expression. |
Constructors
TaskRole()
protected TaskRole()
TaskRole(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected TaskRole(ByRefValue reference)
Parameters
- reference Amazon.
JSII. Runtime. Deputy. By Ref Value The Javascript-owned object reference
TaskRole(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected TaskRole(DeputyBase.DeputyProps props)
Parameters
- props Amazon.
JSII. Runtime. Deputy. Deputy Base. Deputy Props The deputy props
Properties
Resource
Retrieves the resource for use in IAM Policies for this TaskRole.
public abstract string Resource { get; }
Property Value
System.
RoleArn
Retrieves the roleArn for this TaskRole.
public abstract string RoleArn { get; }
Property Value
System.
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
FromRoleArnJsonPath(String)
Construct a task role retrieved from task inputs using a json expression.
public static TaskRole FromRoleArnJsonPath(string expression)
Parameters
- expression System.
String json expression to roleArn.
Returns
Examples
TaskRole.FromRoleArnJsonPath("$.RoleArn");