Skip to main content

AWS IAM ExecModule

Overview

AwsIamModule brings bounded AWS Identity and Access Management operations into ValkyrAI workflows. It inventories IAM users and groups, creates and updates explicitly named identities, permanently deletes reviewed identities, and changes group memberships. The connector uses ValkyrAI's native map ABI and one verified IntegrationAccount; credentials never belong in workflow input.

The connector implements thirteen operations:

  • list_users, get_user, create_user, update_user, and delete_user cover IAM user discovery and lifecycle.
  • list_groups, get_group, create_group, update_group, and delete_group cover IAM group discovery, member inspection, and lifecycle.
  • list_groups_for_user, add_user_to_group, and remove_user_from_group cover explicit group-membership reconciliation.

n8n's AWS IAM node provides the functional workflow reference for user and group resources, operation-driven configuration, AWS credential binding, and searchable entity selection. ValkyrAI adds strict per-operation field allowlists, verified IntegrationAccount state, bounded pagination, explicit confirmation for every mutation, confidential output classification, read-only retries, and deterministic reconciliation after ambiguous provider failures.

Usage

  1. Define the exact IAM users, groups, paths, and membership changes the workflow may manage.
  2. Create a dedicated least-privilege IAM principal whose policy permits only those operations and resources.
  3. Store its access key ID and secret access key in an AWS IntegrationAccount; verify it and keep it in READY status.
  4. Add AwsIamModule and bind that account through ExecModuleConfig.authConfig.integrationAccount.
  5. Run read operations first to inventory current state and capture exact user or group names.
  6. Provide only fields accepted by the selected operation. Unexpected fields fail before AWS access.
  7. Set the operation-specific confirmation field to exactly true for every mutation.
  8. After a timeout or transport failure, reconcile the exact user, group, or membership before replaying anything.

Never place an AWS access key, secret key, session token, or credentials object in module input. Those fields are rejected before any network request. IAM inventory, paths, identifiers, and membership state are confidential and belong only in ACL-scoped workflow state.

Inputs

NameTypeRequired forDefaultConstraints
operationstringEvery executionNoneOne of the thirteen documented operations.
markerstringOptional list fieldNoneOpaque IAM continuation marker, at most 2,048 characters.
limitintegerOptional list field100Total result bound from 1 through 10,000.
returnAllbooleanOptional list fieldfalseFollow pages until limit, exhaustion, or 100 pages.
pathPrefixstringOptional list_users / list_groups filterNoneAbsolute IAM path, beginning and ending with /, at most 512 characters.
userNamestringUser, membership, and user-group operationsNone1-64 IAM name characters: letters, digits, _+=,.@-.
newUserNamestringOptional update_user replacementNoneSame rules as userName; at least one update field is required.
groupNamestringGroup and membership operationsNone1-128 IAM name characters: letters, digits, _+=,.@-.
newGroupNamestringOptional update_group replacementNoneSame rules as groupName; at least one update field is required.
pathstringOptional user/group create fieldProvider rootAbsolute IAM path, beginning and ending with /.
newPathstringOptional user/group update fieldUnchangedAbsolute IAM path, beginning and ending with /.
confirmCreatebooleancreate_user, create_groupfalseMust be exactly true.
confirmUpdatebooleanupdate_user, update_groupfalseMust be exactly true.
confirmDeletebooleandelete_user, delete_groupfalseMust be exactly true; deletion is permanent.
confirmMembershipChangebooleanAdd/remove membershipfalseMust be exactly true.

get_group is a paginated member read: data contains the group summary and items contains bounded user summaries. list_groups_for_user returns group summaries for one exact user.

Outputs

Every call returns stable status, operation, and attempts fields.

NameTypeWhen presentDescription
statusstringAlwayssuccess or error.
operationstringAlwaysNormalized operation.
attemptsintegerAlwaysProvider calls including pages and retry-safe reads.
resultTypestringSuccessUser, group, member, or mutation-result family.
itemsarrayList/member successBounded user or group summaries.
countintegerItems are presentNumber of returned summaries.
pagesintegerPaginated successProvider pages consumed.
hasMorebooleanPaginated successWhether AWS returned another marker.
markerstringAnother page existsOpaque continuation marker.
dataobjectSingle read or mutation successNormalized entity or acceptance receipt.
requestIdstringAWS supplies oneBounded provider reference for reconciliation.
errorobjectFailureSafe {code, message, httpStatus?, retryable} details.

User summaries contain bounded userName, userId, arn, path, creation/password-use timestamps, and permissions-boundary metadata when AWS returns it. Group summaries contain bounded groupName, groupId, arn, path, and creation time. Mutation receipts contain only the expected resulting state and never credentials or provider exception text.

IntegrationAccount Requirements

Bind one AWS IntegrationAccount through the normalized ExecModule authentication relationship:

FieldRequirement
ProviderAmazon Web Services / IAM
statusMust be READY.
verifiedMust be true.
apiKey SecureFieldAWS access key ID.
password SecureFieldAWS secret access key.

Grant only the actions enabled for the reviewed workflow:

  • User reads: iam:ListUsers and iam:GetUser.
  • User lifecycle: iam:CreateUser, iam:UpdateUser, and iam:DeleteUser on approved paths and names.
  • Group reads: iam:ListGroups, iam:GetGroup, and iam:ListGroupsForUser.
  • Group lifecycle: iam:CreateGroup, iam:UpdateGroup, and iam:DeleteGroup on approved paths and names.
  • Membership changes: iam:AddUserToGroup and iam:RemoveUserFromGroup for explicit users and groups.

IAM list actions may require account-level resource scope because AWS does not support resource-level permissions for every list API. Use IAM policy conditions, permission boundaries, service control policies, separate accounts, and operator review to reduce blast radius.

The connector currently supports a long-lived access-key pair. STS session credentials, role assumption, workload identity, access-key lifecycle, console passwords, MFA devices, policies, roles, service-linked roles, instance profiles, tags, permission simulation, credential reports, account aliases, signing certificates, SSH public keys, and server certificates are intentionally deferred.

Configuration

The awsAccount relationship is the only credential configuration. Operation, name, path, pagination, and safety fields belong in mapped input or module parameters.

{
"version": "1.0.0",
"authConfig": {
"authStrategy": 1,
"integrationAccount": "integration-account:aws-iam-production"
},
"payloadConfig": {
"parameters": "{\"operation\":\"add_user_to_group\"}"
}
}

The relationship value is illustrative. Persisted workflows bind the generated IntegrationAccount relationship, never plaintext credentials.

Operations

OperationProvider behaviorSide effect and retry behavior
list_usersLists bounded user summaries, optionally below pathPrefix.Read-only; each page retries transient failures.
get_userReads one exact IAM user and boundary metadata.Read-only; bounded retry.
create_userCreates one named user at the optional path.Confirmed identity mutation; exactly one attempt.
update_userRenames or moves one exact user.Confirmed identity mutation; exactly one attempt.
delete_userPermanently deletes one exact user.Destructive; confirmation and exactly one attempt.
list_groupsLists bounded group summaries, optionally below pathPrefix.Read-only; each page retries transient failures.
get_groupReads group metadata and bounded member users.Read-only; opaque pagination and bounded retry.
create_groupCreates one named group at the optional path.Confirmed identity mutation; exactly one attempt.
update_groupRenames or moves one exact group.Confirmed identity mutation; exactly one attempt.
delete_groupPermanently deletes one exact empty group.Destructive; confirmation and exactly one attempt.
list_groups_for_userLists bounded groups containing one exact user.Read-only; opaque pagination and bounded retry.
add_user_to_groupAdds one exact user to one exact group.Confirmed membership mutation; exactly one attempt.
remove_user_from_groupRemoves one exact user from one exact group.Confirmed membership mutation; exactly one attempt.

Errors and Failure Modes

CodeTypical causeRetryableResolution
VALIDATION_ERRORMissing/malformed name, path, pagination value, update field, or confirmation.NoCorrect the named input; no provider request was sent.
UNSUPPORTED_OPERATIONUnknown operation.NoSelect a documented operation.
INTEGRATION_ACCOUNT_ERRORAccount missing, unverified, not READY, or missing key material.NoRepair and bind the AWS account.
AWS_IAM_HTTP_400Invalid input, existing entity, missing entity, delete conflict, or policy constraint.Reads may retry only selected transient codesInspect the exact IAM entity state and request ID.
AWS_IAM_HTTP_403IAM, permission-boundary, SCP, or account policy denied the request.NoGrant only the missing action or revise the reviewed workflow.
AWS_IAM_HTTP_404User or group no longer exists.NoReconcile the exact entity name.
AWS_IAM_HTTP_429 / 500 / 503Throttle or transient provider pressure.Reads retry; mutations report ambiguityInspect the exact entity or membership before replay.
NETWORK_ERRORDNS, TLS, timeout, or connectivity failure.Reads retry; mutations report ambiguityTreat provider acceptance as unknown until state is checked.
EXECUTION_ERRORUnexpected bounded runtime failure.No automatic replayPreserve operation and request evidence for investigation.

Provider exception messages are never copied into workflow output. This prevents credentials, entity details, policy context, or provider diagnostics from leaking through errors.

Example

Add an existing automation user to a reviewed least-privilege group:

{
"operation": "add_user_to_group",
"userName": "workflow-auditor",
"groupName": "ReadOnlyAuditors",
"confirmMembershipChange": true
}

Expected result shape:

{
"status": "success",
"operation": "add_user_to_group",
"attempts": 1,
"resultType": "membership_change",
"data": {
"accepted": true,
"expectedMembership": "present"
},
"requestId": "aws-request-reference"
}

The receipt proves only that AWS accepted the request. Verify the result with get_group or list_groups_for_user before treating the membership as current.

Notes

  • Pagination: list_users, list_groups, get_group, and list_groups_for_user return one page unless returnAll=true; the connector follows opaque markers with unchanged filters and stops at limit, exhaustion, or 100 pages.
  • Rate limits: IAM quotas vary by account and action. Read calls use at most five configured attempts with bounded backoff. Identity and membership mutations never retry automatically.
  • API limits: the connector bounds aggregate results at 10,000, pages at 100, provider page requests at 1,000 items, markers at 2,048 characters, names at AWS limits, and paths at 512 characters. AWS can return fewer items than requested even when another marker exists.
  • Idempotency: list/get operations are safe to retry. Create, update, delete, add, and remove operations are single-attempt and must be reconciled by exact name after an ambiguous response.
  • Destructive behavior: user and group deletion is permanent. AWS rejects deleting users with attached resources or groups with members; this connector does not cascade cleanup.
  • Global service: IAM uses AWS's global service endpoint. The connector does not accept a caller-controlled region or endpoint, preventing credential forwarding to an arbitrary host.
  • Output privacy: IAM identities, paths, ARNs, boundaries, memberships, and request IDs are classified as confidential workflow output.
  • External verification: no live AWS call is made by the repository test suite. Provider behavior requires a separately authorized least-privilege AWS account and reviewed test identities.