Skip to main content

About AWS

Amazon Web Services (AWS) is a public-cloud platform offering on-demand compute, storage, database, identity, and networking services. The Serval AWS integration is multi-product: connecting an AWS account once gives your workflows access to every supported AWS service (see the capability table below) - limited only by the permissions on the IAM role you delegate. Each connected AWS account is its own app instance keyed by its 12-digit account ID. To work across many accounts in an AWS Organization, connect the organization: Serval then creates a connection for each member account. Alternatively, connect one account and let workflows reach your other accounts through a standard role in each (see Reach member accounts from one connection). Authentication: Cross-account IAM role assumption (STS AssumeRole with an External ID). Serval never stores long-lived AWS keys - only your Role ARN and a Serval-generated External ID, exchanged at runtime for short-lived 15-minute session credentials. Data sync: No user or identity sync. The only background sync ingests IAM roles tagged with the key “serval” (including their inline and attached policies) to power temporary role access; everything else is on-demand from workflows.

What the AWS integration enables

For services listed in the API actions row, workflows can call their AWS API operations. DevOps Agent uses dedicated conversation and investigation actions. Route 53 is a global service: its requests still take the region argument - pass us-east-1.

Use DevOps Agent

DevOps Agent uses your existing AWS connection. You don’t need to reconnect, change the Role ARN or External ID, or update existing AWS workflows. The Agent Space ID and AWS Region are workflow inputs, not new connection settings.
  1. Create an Agent Space in AWS and configure its resource access and observability integrations.
  2. Select the AWS connection for that account, or use your existing member-account role routing.
  3. Add the permissions below to the role used by the workflow, scoped to that Agent Space. Keep the role’s existing permissions for other AWS services. Grant only the actions your workflow needs.
Use aws.devopsAgent.createChat and sendMessage for questions and follow-ups. Keep the returned conversation reference for later messages. For investigations, use createInvestigation with a stable idempotency token, then waitForInvestigation, listExecutions, and listJournalRecords. Follow returned pagination tokens when reading findings. Questions and investigation prompts can invoke the Agent Space’s tools, so they use Serval’s approval policy for mutating actions. Check the returned status before presenting a completed answer. This integration doesn’t provision Agent Spaces, approve remediation, or configure agent handoffs. The invocation policy above doesn’t grant the Agent Space access to your workloads; configure that separately in AWS.

Get your credentials

Serval connects to AWS by assuming an IAM role in your account, following AWS’s standard pattern for delegating access to another AWS account. You create the role, tell it to trust Serval’s AWS account for your region with an External ID, and attach whatever permission policies your workflows need - Serval mandates no permissions of its own. Each Serval region runs in its own AWS account, so the account your role trusts depends on where your organization is hosted. Check the address you sign in at, and ask support@serval.com if you’re unsure which region you’re on.
1

Open the Connect AWS dialog in Serval

In Serval, go to Integrations → All integrations → AWS → Connect and leave the dialog open. It displays the Serval AWS Account ID for your region and your workspace’s External ID. Copy both: the trust policy you create next must name that account ID, which matches your region’s row in the table above. Self-hosted deployments trust the account their own worker runs in, not the value shown in the dialog.
2

Create a cross-account role in AWS

In the AWS console, go to IAM → Roles → Create role and choose Another AWS account as the trusted entity.
3

Enter the Serval account and External ID

Enter the Serval AWS Account ID for your region from the table above, tick Require external ID, and paste the External ID from the dialog.
4

Attach permission policies

Attach the policies that grant the actions you want Serval to perform - for example, IAMReadOnlyAccess for read-only IAM workflows. The role’s policies define exactly which AWS APIs Serval can call.
5

Name and create the role

Name the role and click Create role.
6

Add the TagSession statement to the trust policy

Open the new role, go to Trust relationships → Edit trust policy, and add an sts:TagSession statement alongside the existing sts:AssumeRole statement. Both statements use the Serval account principal; keep the sts:ExternalId condition on the AssumeRole statement. Pick the tab for your region and replace <EXTERNAL_ID> (including the angle brackets) with the External ID shown in the Connect AWS dialog:
7

Copy the Role ARN

Copy the Role ARN, then return to the Connect AWS dialog in Serval.
The External ID is deterministic per Serval workspace - it never changes across reconnects, so it’s safe to hardcode in Terraform-managed trust policies.
If you want Serval to run the connection health checks and ingest roles for temporary access, include iam:ListRoles (connection check), organizations:ListAccounts (Organizations check), and the IAM read actions iam:GetRole, iam:ListRolePolicies, iam:GetRolePolicy, iam:ListAttachedRolePolicies, iam:GetPolicy, and iam:GetPolicyVersion (role ingestion) in the role’s policies.

Connect in Serval

1

Open Integrations → All integrations → AWS → Connect

The dialog shows two read-only values: Serval AWS Account ID and External ID (your workspace’s stable, Serval-generated value). These are for use in AWS - you don’t edit them. The account ID to trust for your region is in Get your credentials.
2

Role ARN (required)

Paste the Role ARN of the cross-account role you created. The account ID appears beneath the ARN as AWS account: 123456789012. This becomes the connection’s identifier in Serval.
3

Connection name (required)

Enter a display label to tell accounts apart in Serval (for example, “Production”). It’s a label only and doesn’t affect the connection.
4

Connect AWS

Connect AWS becomes available after the External ID loads and you enter a name and a valid Role ARN.
The dialog rejects a malformed Role ARN before you can submit (it must look like arn:aws:iam::123456789012:role/<name>), but a well-formed ARN for a role that doesn’t exist or doesn’t trust Serval still connects and only fails when you run the “Test AWS Connection” health check, so verify the ARN before submitting.
To connect additional AWS accounts, repeat the connect flow once per account - each account is a separate connection. If your accounts belong to an AWS Organization, you can instead connect the organization.

Verifying the connection

After connecting, run the health checks from the app instance page. Test AWS Connection - verifies Serval can assume your cross-account role by making a minimal IAM read call.
  • Success: “Successfully authenticated with AWS”
  • Role assumption fails (for example, a trust policy naming the wrong Serval account or lacking sts:TagSession, an External ID mismatch, or a nonexistent role): “Unable to authenticate with AWS. Please verify your cross-account role ARN and external ID are correct.”
  • If role assumption works but the role can’t read IAM: “Connection successful, but IAM role lacks iam:ListRoles permission.”
  • If role assumption works but the IAM request fails for another reason: “Authenticated with AWS, but the IAM ListRoles request failed.”
For a role limited to DevOps Agent, the missing iam:ListRoles message confirms that role assumption succeeded. DevOps Agent actions don’t require this permission. Add it only if you want the generic health check to pass, and verify DevOps Agent access by running a DevOps Agent action. List AWS Organization Accounts - verifies the role can list accounts in your AWS Organization.
  • Success: “Successfully retrieved [number] accounts from AWS Organizations”
  • Role assumption fails: “Unable to authenticate with AWS. Please verify your cross-account role ARN and external ID are correct.”
  • Standalone account (not in an Organization): “This AWS account is not part of an AWS Organization.”
  • Permission missing but auth working: “Connection successful, but IAM role lacks organizations:ListAccounts permission.”
  • Any other failure, such as throttling or a network problem (ignore the permission advice and read the error shown beneath the message): “Unable to access AWS Organizations. Ensure the IAM role has organizations:ListAccounts permission.”
“Test AWS Connection” is the authoritative connectivity signal. If it passes but “List AWS Organization Accounts” fails with “This AWS account is not part of an AWS Organization.”, your connection is healthy - that result is expected for standalone accounts.

Connect an AWS Organization

If your AWS accounts belong to an AWS Organization, connect the organization once. Serval then connects each member account for you. How it works:
  • Hub role: you create a role in the management account or in a delegated administrator account. Serval assumes it with your team’s External ID to read the organization’s accounts and organizational units (OUs). Serval reads the organization again every 15 minutes.
  • Member role: you deploy a role named ServalMemberRole to member accounts with a service-managed CloudFormation StackSet from Serval’s template. The member role trusts Serval’s AWS account directly, not the hub role, and requires your team’s External ID.
  • Child connections: Serval assumes each member role and creates one AWS connection for each member account it can reach. Your team owns these child connections. Workflows, ingestion, and health checks use them like any other AWS connection.
StackSets don’t deploy to the management account. The organization connection itself covers that account. Both roles trust the Serval AWS account for your region, listed in Get your credentials. The Connect AWS dialog shows your team’s External ID.
To reach member accounts from workflows without a connection for each account, see Reach member accounts from one connection.

Create the hub role

Create the hub role in the management account or in a delegated administrator account.
  1. Create a role whose trust policy matches the one in Get your credentials for your region. It allows sts:AssumeRole from Serval’s AWS account with your team’s External ID, plus sts:TagSession for the same account.
  2. Attach this permissions policy:
    The “Test AWS Connection” health check calls iam:ListRoles.
  3. Copy the Role ARN.

Connect the organization in Serval

1

Open the Connect AWS dialog

Go to Integrations → Connect new → AWS → Connect.
2

Choose Organization

Choose Organization at the top of the dialog. If your member accounts already have a role that trusts Serval directly, enter its exact name (including any path) in Member account role name. Otherwise, use ServalMemberRole when deploying the template. A new StackSet is not required to reuse correctly configured existing roles.
3

Enter the discovery role and connection name

Paste the management or delegated administrator role’s ARN into Discovery role ARN. The account ID appears beneath the ARN for confirmation. Enter a Connection name to identify it in Serval.
4

Connect AWS

Serval checks the hub role and organization identity before it saves the connection. If the check fails, the dialog shows the error under the field:
  • “Serval could not assume the AWS role; check that its trust policy allows Serval’s AWS account and this team’s External ID”: the trust policy names the wrong account or the External ID doesn’t match.
  • An error that names an organizations: action: the hub role lacks that permission.
  • An error about the account: Serval accepts only the management account or a registered delegated administrator.
After saving, Serval discovers and connects member accounts in the background. You can leave the page while it runs. Member accounts shows the sync status and any error. If discovery fails, check the hub role’s Organizations permissions and select Sync now to retry.

Deploy the member role

If the member roles already exist and trust Serval directly with this connection’s External ID, you can reuse them. Select Sync now to check access. To deploy missing roles, open Set up member account access → Deploy missing roles with a StackSet on the organization connection’s page. It includes:
  • A Download template button that saves the member role template, serval-member-role.yaml.
  • Every template parameter with its default value.
  • An Open StackSet setup in the AWS console link.
  • AWS CLI commands to copy with Copy commands.
Before you start, turn on trusted access for CloudFormation StackSets in AWS Organizations.
  1. On the connection’s page, select Download template.
  2. In the management account, go to CloudFormation → StackSets → Create StackSet, or select Open StackSet setup in the AWS console on the connection’s page.
  3. Choose Service-managed permissions.
  4. Choose Upload a template file and select serval-member-role.yaml.
  5. Enter the parameters shown on the connection’s page.
  6. Deploy to the organization, or to specific OUs.
  7. Choose one Region only. IAM is global, so a second Region fails.
  8. Keep automatic deployment on, so new accounts in the targeted OUs get the role.
  9. Acknowledge that the template creates IAM resources with custom names, and submit.
Wait until the stack instances show CURRENT. If an account already has a role with the same name, its stack instance fails and changes nothing. Override RoleName for that stack instance only. The template takes these parameters:
With EnableAccessProvisioning on, any other role Serval creates can carry any inline policy. Turn it on only if Serval should provision AWS access in your member accounts.

Sync member accounts

On the organization connection’s page, select Sync now. The Member accounts table refreshes while the sync is pending or running. Each run checks up to 500 accounts; larger organizations continue from the saved position on the next scheduled run. Each member account has one of these statuses: On the Integrations page, child connections appear under the organization connection, which shows a badge with the account count, such as 12 accounts. To open a child connection, select it in the Member accounts table.
  • Existing connections: if your team already connected a member account by hand, the sync links that connection instead of creating a duplicate. If two of your team’s connections hold the same account, the member stays Not connected and the error names both connections.
  • Removing the organization: when you remove the organization connection, Serval turns off its child connections.

Change member role permissions

To change what Serval can do in member accounts, update the StackSet parameters.
  1. In the management account, go to CloudFormation → StackSets in the Region where you created the StackSet.
  2. Select the StackSet, then choose Actions → Edit StackSet details.
  3. Choose Use current template.
  4. Change the parameter values.
  5. On the deployment options page, enter the organization root ID or the same OU IDs you deployed to, and the same Region. The root ID looks like r-ab12. Find it in AWS Organizations → AWS accounts next to Root, or on the StackSet’s Stack instances tab.
  6. Acknowledge the IAM resources and select Submit.
  7. Wait until the stack instances show CURRENT.
New permissions apply on Serval’s next call. You don’t need to do anything in Serval. To remove access, follow the same steps. The AWS CLI equivalent, which adds two managed policies and keeps every other parameter:
  • Your own policies: AdditionalManagedPolicyArns takes AWS managed policies only. A customer managed policy’s ARN contains its account ID, so attach your own policies to ServalMemberRole yourself, for example with your own StackSet. Updating the Serval StackSet keeps policies attached outside it.
  • Different permissions per OU or account: use StackSet parameter overrides on those stack instances.

Use member accounts in workflows

Child connections are regular AWS connections, so workflows target them the same way. This workflow lists a few IAM roles in every connected AWS account:
To target one account, use aws.context.AWSIntegrationFromServiceInstanceID<"member", "<12-digit account ID>"> instead.

Troubleshoot an organization connection

The organization connection’s health check calls iam:ListRoles on the hub role. Add iam:ListRoles to the hub role’s permissions.
Serval couldn’t assume the member role in that account. Check that:
  • The account’s stack instance shows CURRENT.
  • The stack instance’s RoleName matches the connection’s Member account role name.
  • The stack instance’s ServalExternalId matches your team’s External ID.
The hub role’s trust policy must allow the Serval AWS account for your region and require your team’s External ID. Compare it with the trust policy in Get your credentials.
Enter the organization root ID, such as r-ab12, to keep deploying to the whole organization. It’s in AWS Organizations → AWS accounts next to Root, and on the StackSet’s Stack instances tab.

Reach member accounts from one connection

If you don’t want a connection for each member account, one connection can reach every account in your AWS Organization:
  • Connect one account, called the hub.
  • Deploy a standard IAM role to each member account.
  • Workflows assume that role in whichever account they need.
The connection covers an account you add later as soon as the member role exists in it. You don’t change the connection.
Role ingestion and temporary (JIT) role access work per connection: they read and grant IAM roles only in the connected account. The connection’s health checks also test only the hub account. To make another account’s roles requestable through AWS Role Ingestion, connect that account separately or connect the organization.
1

Connect the hub account

Connect one account by following Get your credentials and Connect in Serval.Only the management account can list your organization’s accounts, or a member account that the management account has made a delegated administrator for AWS Organizations. Use one of those as the hub.
2

Let the hub role list accounts and assume member roles

Add these permissions to the hub role. Replace serval/ServalReadOnly with the path and name you give the member role in the next step.
3

Deploy a member role to every account

In each member account, create a role with that path and name.The trust policy names your hub role, not Serval’s AWS account. It must allow both sts:AssumeRole and sts:TagSession. Serval’s sessions carry session tags, and AWS passes those tags along when the hub role assumes another role. Replace <HUB_ACCOUNT_ID> and <HUB_ROLE_NAME> with your hub role’s account ID and name:
Attach only the permissions your workflows need in member accounts. For example, ec2:DescribeInstances for EC2 inventory, or AWS’s ViewOnlyAccess managed policy for read-only lookups.To cover every account, including ones you add later, deploy the role with a CloudFormation StackSet:
  • Use service-managed permissions and turn on automatic deployment.
  • Target a single Region. IAM roles are global, so deploying to a second Region fails.
  • StackSets don’t deploy to the management account. Create the role there by hand only if workflows need it.
4

Target member accounts from workflows

A workflow gives aws.context.forAccount the member account ID, the member role’s path and name, and a Region. It then passes the result to any AWS action, the same way it passes its own context:
To loop over the organization, list accounts with aws.organizations.apiRequest (listAccounts) on the hub connection first.To inventory EC2 instances without writing a workflow, install the prebuilt ingestion (Inventory EC2 across the organization).
How member-account calls behave:
  • Short sessions: each member-account call uses a 15-minute session on the member role. CloudTrail in the member account records these sessions under the name serval-workflow.
  • No fallback: if Serval can’t assume the member role, the action fails. It never falls back to the hub account.
  • Your IAM policies set the boundary: Serval doesn’t check AWS Organizations membership before assuming a role. The hub role’s sts:AssumeRole permission and each member role’s trust policy decide which accounts and roles workflows can reach.
  • Separate External ID: Serval’s External ID protects only the hub role. If a member role’s trust policy requires its own External ID, pass it to aws.context.forAccount as externalId.
  • Commercial Regions only: member-account access doesn’t support China or AWS GovCloud (US) Regions.
For access requests across accounts managed with IAM Identity Center, connect the account that administers Identity Center. That’s the management account or the Identity Center delegated administrator. Workflows can then create and remove account assignments with the SSO Admin actions createAccountAssignment and deleteAccountAssignment. No member role is needed. One way to use them is in custom provisioning workflows.

Inventory EC2 across the organization

The Ingest EC2 from AWS Organization workflow syncs EC2 instances from every active account in the organization into a Databases item type, through the member role. Each full sync finds the accounts again, so it picks up an account you add once its member role exists.
  1. On the AWS app page, open Manage Ingestions. Under Available Ingestion Workflows, choose Install & Add next to Ingest EC2 from AWS Organization. The Manage Ingestions tab appears when your team uses Databases.
  2. Enter:
    • the Organization ID (o-...);
    • the member role’s path and name;
    • the Regions to inventory. Each Region must be enabled in every included account.
    Optionally, list accounts to skip, such as the management account if it has no member role. If the member role’s trust policy requires an External ID, enter it too.
  3. Set the instance arn as the item type’s Key Field. Other useful fields include accountId, accountName, region, InstanceId, InstanceType, State, IP addresses, and Tags.
Permissions: the hub role needs organizations:DescribeOrganization, organizations:ListAccounts, and sts:AssumeRole plus sts:TagSession on the member role. That’s the policy in the “Let the hub role list accounts and assume member roles” step of Reach member accounts from one connection. Each member role needs ec2:DescribeInstances. STS Region: the workflow assumes member roles through STS in us-east-1, so keep STS active in that Region in every included account. Failures: if AWS denies access to an account or Region, the sync fails and its error names the account and Region. It never reports an empty inventory. Leave Delete missing items off until you’ve confirmed the scope and field mappings.

Gotchas and troubleshooting

The generic “Test AWS Connection” check assumes your role and then calls iam:ListRoles. A role limited to DevOps Agent can authenticate successfully while this permission check fails. Grant iam:ListRoles only if you want that check to pass; DevOps Agent actions don’t require it. See Verifying the connection for the messages that distinguish authentication failures from missing permissions.
Standalone AWS accounts that aren’t part of an AWS Organization will always fail the “List AWS Organization Accounts” check with “This AWS account is not part of an AWS Organization.” This does not mean the connection is broken - “Test AWS Connection” is the check that matters for connectivity.
The IAM role sync filters to roles carrying a tag with the key “serval” - an account full of roles syncs zero resources until they’re tagged. If a connected account’s role list looks empty in Serval, check tags before debugging the connection.
The dialog and Serval both reject a malformed Role ARN (anything that isn’t arn:aws:iam::<12-digit account ID>:role/<name>) before the connection is saved. A well-formed ARN for a role that doesn’t exist or doesn’t trust Serval still connects “successfully” and fails later at “Test AWS Connection” with “Unable to authenticate with AWS. Please verify your cross-account role ARN and external ID are correct.”
No region is stored on the connection - every workflow API action takes an explicit region. IAM is global so any region works for it, but a region must still be provided. Health checks default to us-east-1.
The External ID is derived from your Serval workspace ID, so the same workspace always sees the same value - it survives reconnects. This is intentional so the ID can live in Terraform-managed trust policies without breaking.
Each connected AWS account is its own app instance keyed by the 12-digit account ID. There are three ways to cover several accounts:
  • Connect the organization: Serval creates a connection for each member account that has the member role (Connect an AWS Organization).
  • Connect each account: workflows can then target a specific account or iterate over all connected accounts. Role ingestion and temporary role access need this, because they only see the connected account.
  • Connect one hub account: workflows reach the others through a member role (Reach member accounts from one connection).
Every role assumption requests a 15-minute session with a unique session name, and credentials refresh automatically on expiry - long-running workflows reassume the role transparently. Each assumption appears as a separate session in CloudTrail, so don’t be alarmed by many short sessions.
Unlike most integrations, AWS requests aren’t routed through Serval’s host-allow-listed HTTP proxy: AWS request signing must happen client-side, so the workflow worker uses short-lived credentials to call AWS service endpoints (*.amazonaws.com) directly. The effective outbound surface is the endpoints of every service listed in the capability table under “What the AWS integration enables,” plus AWS STS for the credential exchange Serval performs on your connection’s behalf.
Each Serval region runs in its own AWS account, and the trust policy must name the one that assumes your role: 992382851720 for United States organizations (app.serval.com), 311208284913 for European Union organizations (app.eu1.serval.com), and the account your own worker runs in for self-hosted deployments. The Connect AWS dialog shows the account for the region you’re signed in to, and the trust policy must name that same account. If the dialog shows 992382851720 on a European Union tenant, that build predates the region-aware dialog, so use the table in Get your credentials instead. Serval can’t assume a role that trusts a different account, and “Test AWS Connection” fails with “Unable to authenticate with AWS. Please verify your cross-account role ARN and external ID are correct.” If you’re self-hosted, ignore the value in the dialog and confirm the worker’s account ID with your Serval contact before writing the trust policy.

Need help? Contact support@serval.com for assistance with your AWS integration.