Skip to content

Connect an AWS SDK or CLI

Issue Signature v4 credentials for a role and point the official AWS CLI or an AWS SDK at Stegflow to drive your workflows.

Prerequisites

  • A running Stegflow instance you can sign in to (see Getting started).
  • A role with the permissions your client needs. If you do not have one yet, see Create a role.
  • The AWS CLI v2, or any AWS SDK (for example boto3).

Steps

1. Generate credentials

In the console, open the role and generate an access key. Stegflow returns an Access Key ID and a Secret Access Key, the pair the AWS Signature v4 process signs requests with.

Generating credentials for a role

The secret is shown only once

Copy the secret access key when it is displayed and store it securely; it cannot be retrieved again. Set an expiry when you can, and delete keys you no longer use.

2. Configure the AWS client

Give the client the access key, the secret, a region and the Stegflow endpoint URL. Any region works: Stegflow does not validate it, but the AWS tooling requires one to be set. Use whichever method fits your setup.

~/.aws/credentials:

[stegflow]
aws_access_key_id = <ACCESS_KEY_ID>
aws_secret_access_key = <SECRET_ACCESS_KEY>

~/.aws/config:

[profile stegflow]
region = us-east-1
endpoint_url = http://localhost:8080
export AWS_ACCESS_KEY_ID="<ACCESS_KEY_ID>"
export AWS_SECRET_ACCESS_KEY="<SECRET_ACCESS_KEY>"
export AWS_DEFAULT_REGION="us-east-1"
export AWS_ENDPOINT_URL="http://localhost:8080"
import boto3

sfn = boto3.client(
    "stepfunctions",
    endpoint_url="http://localhost:8080",
    region_name="us-east-1",
    aws_access_key_id="<ACCESS_KEY_ID>",
    aws_secret_access_key="<SECRET_ACCESS_KEY>",
)

3. Run a command

Confirm the connection by listing the state machines in the tenant, then start an execution using an ARN from that output=== "AWS CLI"

```bash
aws --profile stegflow stepfunctions list-state-machines

aws --profile stegflow stepfunctions start-execution --state-machine-arn <STATE_MACHINE_ARN>
```

Using the sfn client you configured above:

print(sfn.list_state_machines())

sfn.start_execution(stateMachineArn="<STATE_MACHINE_ARN>")

Success

A JSON response with an executionArn means the client is authenticated and your role is allowed to start executions.

Result

Your AWS CLI or SDK now talks to Stegflow with scoped credentials. Reuse the same access key from activity workers or CI, and see AWS compatibility for the full list of supported actions.