Skip to main content

AWS Secrets Manager ExecModule

Overview

AwsSecretsManagerModule brings governed AWS Secrets Manager operations into ValkyrAI workflows. It discovers secret metadata, reads version state, retrieves an explicitly approved value into confidential workflow output, and performs reviewable lifecycle changes. The connector uses ValkyrAI's native map ABI and a verified IntegrationAccount; AWS credentials never belong in workflow input.

The connector implements eleven operations:

  • list_secrets, describe_secret, and list_secret_versions expose bounded metadata without secret values.
  • get_secret_value retrieves one approved version only after confirmRevealSecret=true.
  • create_secret, put_secret_value, and update_secret create or change secret material without echoing it in mutation receipts.
  • delete_secret schedules recoverable deletion for 7-30 days, while restore_secret cancels a scheduled deletion.
  • rotate_secret configures or starts rotation with a caller UUID token.
  • update_version_stage moves a staging label such as AWSCURRENT to a reviewed version.

n8n's reusable AWS credential/region model and AWS Secrets Manager external-secret integration provide the functional workflow reference. ValkyrAI adds a dedicated native module with strict per-operation fields, full-ARN region checks, explicit secret-reveal and mutation confirmations, confidential output classification, read-only retry, recoverable deletion only, and deterministic provider-state reconciliation.

Usage

  1. Identify the exact AWS region, secret names or full ARNs, KMS keys, version stages, and rotation function the workflow may access.
  2. Create a least-privilege IAM principal restricted to those Secrets Manager actions 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 AwsSecretsManagerModule and bind the account through ExecModuleConfig.authConfig.integrationAccount.
  5. Use list_secrets, describe_secret, and list_secret_versions before changing state.
  6. Set the exact confirmation field for value reads and mutations. Unexpected fields fail before provider access.
  7. Reconcile the returned ARN, version ID, staging labels, deletion date, or rotation state after a timeout; never blindly replay a mutation.

Never place an AWS access key, secret key, session token, or credentials object in module input. Those fields are rejected before any network request. Secret names, ARNs, descriptions, tags, KMS references, version IDs, staging labels, rotation configuration, and secret values are confidential and belong only in ACL-scoped workflow state.

Inputs

NameTypeRequired forDefaultConstraints
operationstringEvery executionNoneOne of the eleven documented operations.
regionstringEvery executionNoneAWS region such as us-west-2; custom endpoints are not accepted.
secretIdstringExisting-secret operationsNoneSecret name or complete Secrets Manager ARN whose region matches region; at most 2,048 characters.
secretNamestringcreate_secretNone1-512 AWS-safe characters; the reserved aws/ prefix is rejected.
nextTokenstringOptional list fieldNoneOpaque provider token, at most 4,096 characters.
limitintegerOptional list field100Total result bound from 1 through 10,000.
returnAllbooleanOptional list fieldfalseFollow pages until limit, exhaustion, or 100 pages.
includePlannedDeletionbooleanOptional list_secrets fieldfalseInclude metadata for secrets scheduled for deletion.
includeDeprecatedbooleanOptional version-list fieldfalseInclude versions that have no staging labels.
filtersobjectOptional list_secrets fieldEmptyUp to 10 AWS filters, each with 1-10 bounded strings.
versionIdstringOptional value readProvider current version32-64 safe version-ID characters.
versionStagestringOptional value/write; required stage moveProvider current stageStaging label up to 256 characters.
secretStringstringSecret create/version; optional updateNoneExactly one string or binary value; 1-65,536 characters; never echoed in mutation receipts.
secretBinaryBase64stringSecret create/version; optional updateNoneBase64 that decodes to 1-65,536 bytes.
clientRequestTokenstringCreate, put, rotate; value-changing updateNoneCaller UUID used as the immutable AWS version/idempotency token.
descriptionstringOptional create/update fieldNoneSafe text up to 2,048 characters.
kmsKeyIdstringOptional create/update fieldAWS managed keyKMS key ID, alias, or ARN up to 2,048 characters.
tagsobjectOptional create_secret fieldEmptyUp to 50 key/value pairs; aws: keys are rejected.
recoveryWindowDaysintegerOptional delete_secret field307-30 days; immediate force deletion is intentionally unsupported.
rotationLambdaArnstringOptional rotate_secret fieldExisting configurationComplete same-region Lambda function ARN.
automaticallyAfterDaysintegerOptional rotation ruleProvider default1-1,000; cannot be combined with scheduleExpression.
rotationDurationstringOptional rotation ruleProvider defaultBounded hourly duration such as 2h.
scheduleExpressionstringOptional rotation ruleProvider defaultBounded rate(...) or cron(...); cannot be combined with automaticallyAfterDays.
rotateImmediatelybooleanOptional rotate_secret fieldtrueWhether AWS should start rotation immediately.
moveToVersionIdstringupdate_version_stageNoneVersion that receives versionStage.
removeFromVersionIdstringOptional stage moveProvider inferenceVersion that loses versionStage.
confirmRevealSecretbooleanget_secret_valuefalseMust be exactly true.
confirmCreateSecretbooleancreate_secretfalseMust be exactly true.
confirmPutSecretValuebooleanput_secret_valuefalseMust be exactly true.
confirmUpdateSecretbooleanupdate_secretfalseMust be exactly true.
confirmDeleteSecretbooleandelete_secretfalseMust be exactly true.
confirmRestoreSecretbooleanrestore_secretfalseMust be exactly true.
confirmRotateSecretbooleanrotate_secretfalseMust be exactly true.
confirmUpdateVersionStagebooleanupdate_version_stagefalseMust be exactly true.

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.
resultTypestringSuccessSecret metadata, version, value, or lifecycle receipt family.
itemsarrayList successBounded secret or version metadata.
countintegerItems are presentNumber of returned items.
pagesintegerPaginated successProvider pages consumed.
hasMorebooleanPaginated successWhether AWS returned another token.
nextTokenstringAnother page existsOpaque continuation token.
dataobjectSuccessMetadata, confidential secret value, or redacted mutation receipt.
requestIdstringAWS supplies oneBounded request reference for reconciliation.
errorobjectFailureSafe {code, message, httpStatus?, retryable} details.

get_secret_value returns secretString or secretBinaryBase64 because retrieval is the purpose of that operation. The entire module output is classified as secret. Mutation receipts contain only safe identifiers, version/stage state, acceptance markers, deletion timing, and request references; they never repeat submitted secret material.

IntegrationAccount Requirements

Bind one AWS IntegrationAccount through the normalized ExecModule authentication relationship:

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

Grant only the actions enabled for the workflow:

  • Discovery: secretsmanager:ListSecrets, secretsmanager:DescribeSecret, and secretsmanager:ListSecretVersionIds.
  • Value read: secretsmanager:GetSecretValue; add kms:Decrypt only for the exact approved customer-managed keys.
  • Create/version/update: secretsmanager:CreateSecret, secretsmanager:PutSecretValue, and secretsmanager:UpdateSecret; add only the required KMS encrypt/data-key permissions.
  • Recoverable lifecycle: secretsmanager:DeleteSecret and secretsmanager:RestoreSecret.
  • Rotation/stages: secretsmanager:RotateSecret and secretsmanager:UpdateSecretVersionStage; narrowly scoped lambda:InvokeFunction and iam:PassRole may be required by reviewed rotation designs.
  • Tag-based policy conditions can restrict access further, but creation with tags also requires the corresponding tagging authorization.

The connector currently supports a long-lived access-key pair. STS session credentials, role assumption, workload identity, custom endpoints, cross-region replication, batch value retrieval, resource-policy mutation, random-password generation, tag changes after creation, rotation cancellation, and replica removal are deferred.

Configuration

The awsAccount relationship is the only credential configuration. Operation, region, secret, version, pagination, rotation, and safety fields belong in mapped input or module parameters.

{
"version": "1.0.0",
"authConfig": {
"authStrategy": 1,
"integrationAccount": "integration-account:aws-secrets-manager-production"
},
"payloadConfig": {
"parameters": "{\"operation\":\"get_secret_value\",\"region\":\"us-west-2\"}"
}
}

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

Operations

OperationProvider behaviorSafety and retry behavior
list_secretsLists bounded secret metadata with filters and optional planned-deletion visibility.Read-only; each page retries transient failures.
describe_secretReads metadata, tags, rotation rules, dates, and version-to-stage mappings.Read-only; bounded retry; no secret value.
get_secret_valueReads one named/ARN version and returns string or base64 binary value.Requires explicit reveal confirmation; confidential read with bounded retry.
list_secret_versionsLists bounded version IDs, stages, KMS IDs, and dates.Read-only; opaque pagination and bounded retry.
create_secretCreates a secret and its first value using a caller UUID token.Confirmed mutation; exactly one provider attempt.
put_secret_valueAdds an immutable value version, optionally with a stage label.Confirmed mutation; caller UUID token; exactly one attempt.
update_secretChanges description/KMS key and optionally creates a new value version.Confirmed mutation; value changes require a caller UUID; exactly one attempt.
delete_secretSchedules deletion after a 7-30 day recovery window.Destructive but recoverable; confirmed and exactly one attempt.
restore_secretCancels scheduled deletion.Confirmed mutation; exactly one attempt.
rotate_secretConfigures or starts asynchronous rotation with optional Lambda/rules.Confirmed mutation; caller UUID token; exactly one attempt.
update_version_stageMoves a staging label to a reviewed version.Confirmed mutation; exactly one attempt.

Errors and Failure Modes

CodeTypical causeRetryableResolution
VALIDATION_ERRORMissing/malformed region, secret ID, ARN, value, version, filter, rule, pagination value, 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_SECRETS_MANAGER_HTTP_400Invalid state, scheduled deletion, version/stage conflict, KMS issue, or reused token with different data.Reads retry only selected transient codesInspect exact provider state and request ID.
AWS_SECRETS_MANAGER_HTTP_403IAM, KMS, Lambda, tag condition, or resource policy denied.NoGrant only the missing action/resource/condition.
AWS_SECRETS_MANAGER_HTTP_404Secret or version no longer exists in the selected region/account.NoReconcile the exact complete ARN or name and version.
AWS_SECRETS_MANAGER_HTTP_429 / 500 / 503Throttle or transient provider pressure.Reads retry; mutations report ambiguityInspect secret/version/stage state before replay.
NETWORK_ERRORDNS, TLS, timeout, or connectivity failure.Reads retry; mutations report ambiguityTreat provider acceptance as unknown until exact 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 access keys, secret values, names, ARNs, tags, descriptions, KMS references, rotation configuration, and provider detail from leaking through errors.

Example

Retrieve one reviewed current secret version:

{
"operation": "get_secret_value",
"region": "us-west-2",
"secretId": "production/payments/api",
"versionStage": "AWSCURRENT",
"confirmRevealSecret": true
}

Expected result shape:

{
"status": "success",
"operation": "get_secret_value",
"attempts": 1,
"resultType": "secret_value",
"data": {
"arn": "arn:aws:secretsmanager:us-west-2:123456789012:secret:production/payments/api-example",
"name": "production/payments/api",
"versionId": "12345678123442349234123456789012",
"versionStages": ["AWSCURRENT"],
"secretString": "[confidential value]"
},
"requestId": "aws-request-reference"
}

The result intentionally contains secret material. Bind it directly to the next confidential operation, keep workflow/object ACLs narrow, and avoid logging, email, analytics, or long-lived serialization.

Notes

  • Pagination: list_secrets and list_secret_versions return one page unless returnAll=true; the connector follows opaque tokens with unchanged inputs and stops at limit, exhaustion, or 100 pages.
  • Rate limits: Secrets Manager quotas and costs vary by account, region, KMS usage, and action. Read calls use at most five configured attempts with bounded backoff. Value and lifecycle mutations never retry automatically.
  • API limits: provider list pages are capped at 100; total results at 10,000; filters at 10 with 10 values each; tags at 50; secret string/binary values at 65,536 characters/bytes; descriptions at 2,048 characters; and deletion recovery at 7-30 days. AWS can impose tighter account-, KMS-, Lambda-, or policy-specific limits.
  • Idempotency: create, put, value-changing update, and rotate use a caller UUID as the AWS client request/version token. Reusing a token with different secret data fails. A stable token does not make an unknown result safe to replay until the exact secret and version state is reconciled.
  • Eventual consistency: list_secrets may lag recent changes. Use describe_secret and list_secret_versions with the exact identifier for reconciliation.
  • Rotation: rotation is asynchronous and can leave AWSPENDING on an incomplete version. After acceptance, inspect metadata/version stages and the rotation Lambda before another rotation request.
  • Destructive behavior: delete_secret never force-deletes. It schedules deletion with at least seven days of recovery. Deleting a replicated primary can fail until replicas are removed; replica operations are intentionally outside this module.
  • Secure values: get_secret_value intentionally places decrypted value material in secret-classified output. secretString and secretBinaryBase64 inputs are passed only to AWS and never copied into mutation receipts or errors. Avoid mapping them into logs, notifications, public content, or non-secret fields.
  • KMS: cross-account secret access requires a complete ARN. Customer-managed keys also need tightly scoped KMS permissions and compatible key policy. AWS's managed aws/secretsmanager key cannot be used for every cross-account scenario.
  • CloudTrail: AWS logs Secrets Manager API calls. Do not place sensitive data in secret names, descriptions, tags, rotation rule text, or other request parameters that AWS records as management events.
  • Deferred operations: BatchGetSecretValue, GetRandomPassword, tag/untag after creation, resource-policy reads/writes/validation, cross-region replication, replica removal, rotation cancellation, and custom endpoints are intentionally not implemented.
  • Provider verification boundary: deterministic tests cover validation, operation families, pagination, retry boundaries, confirmations, value/credential redaction, binary decoding, error normalization, registration, and metadata. Live AWS behavior remains unverified until an authorized AWS account and reviewed secret namespace, KMS policy, versions, and rotation function are supplied.
  • Functional reference: n8n's AWS credential model and external secret store guidance inform reusable AWS credentials and secret-consumption ergonomics. AWS Secrets Manager API reference defines provider behavior. ValkyrAI adds the review, confirmation, redaction, and retry boundaries described above.
  • Runtime boundary: merged source and published documentation do not update the deployed Workflow Studio catalog until a ValkyrAI backend release exposes AwsSecretsManagerModule through /v1/modules/metadata.