> ## Documentation Index
> Fetch the complete documentation index at: https://docs.factorize.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# AWS

> Run AWS Code Mode through a dedicated IAM role without giving Factorize an AWS access key.

AWS Code Mode runs Python on the AWS-hosted MCP server. Factorize authenticates and forwards the request; it does not run the code or keep an AWS action catalog. Make a separate, named Factorize connection for each AWS role or account. The caller selects a connection, not a role ARN.

## Connect an AWS account

1. Open **Settings → Integrations → Add AWS integration**. Name the connection and choose the Region for its AWS MCP endpoint.
2. Download the CloudFormation template. Upload it as a new stack in the target AWS account and acknowledge that it creates IAM resources. If that account already has an OIDC provider for this Factorize issuer, set `CreateProvider` to `false`.
3. Copy the stack's **RoleArn** output to Factorize and click **Verify AWS role**. The Worker assumes the role and signs a harmless Code Mode probe. This verifies the connection, not the full set of API permissions.
4. Optionally give one active Factorize OAuth connection **Use access** and save. That grant applies only to this AWS connection and this exact OAuth installation. Select **No Use access** to revoke it. AWS connections do not appear in workspace defaults or VM grants.

The agent calls `run_aws_script` with `connectionId` and `code`. It needs an active OAuth credential and the connection-specific Use grant, not `integrations:write` or any other additional Factorize scope. Only the owner, in an interactive session with `integrations:write`, can prepare, verify, delete or change access to the connection. It receives the script result and standard output, not authentication material or upstream session headers. The initial tool is request-scoped; Factorize does not poll background AWS tasks or replay timed-out requests. A timeout does not mean a script made no changes. Check AWS before retrying a modifying script.

## Trust and permissions

The starter role allows three inventory reads. Change the IAM permissions for that role in AWS if a workflow needs more; there is no Factorize operation list to maintain. Prefer a different role and Factorize connection for workflows that can write. The Worker gets a 15-minute STS session and signs requests to the AWS MCP endpoint with SigV4. It does not pass credentials to the script. The session narrows the role to the AWS-hosted MCP path and excludes IAM administration, credential chaining, and interactive host access. AWS applies the customer's role, resource and organization policies to the actual calls.

Deleting the connection stops new requests from Factorize. Remove the role or its trust in AWS as well. The template retains the account-wide OIDC provider so it does not break other Factorize roles. Remove that provider separately when no roles use it.

## Deploying the issuer

Before enabling setup, configure the Worker secret `AWS_WORKLOAD_SIGNING_KEYS` with JSON containing `active` (a dedicated RSA private JWK with a unique `kid`) and optional `previous` (up to two public JWKs). Use 2048- or 3072-bit RSA. Do not reuse the browser OAuth signer. The Worker publishes discovery at `<app origin>/oauth/aws/.well-known/openid-configuration` and public keys at `<app origin>/oauth/aws/jwks`; no public endpoint issues workload tokens. Without a configured secret the integration fails closed.

For key rotation, first publish the new public key alongside the old active key and allow for AWS JWKS caching. Then switch the active signer and keep the old public key for the overlap. Never include a private key in the public key set or store it in source control.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.