Credentials

class aws_cdk.aws_stepfunctions.Credentials(*, role)

Bases: object

Specifies a target role assumed by the State Machine’s execution role for invoking the task’s resource.

Parameters:

role (TaskRole) – The role to be assumed for executing the Task.

See:

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

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

role

The role to be assumed for executing the Task.