New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

@postman-cs/onboarding-aws-spec-discovery

Package Overview
Dependencies
Maintainers
7
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@postman-cs/onboarding-aws-spec-discovery

Discover AWS-hosted API specs and hand the result to Postman API onboarding.

latest
Source
npmnpm
Version
3.3.4
Version published
Weekly downloads
18
-87.59%
Maintainers
7
Weekly downloads
 
Created
Source

Postman Enterprise Automation: AWS Spec Discovery

CI Release npm License: MIT

Zero-config discovery and export of API specs from AWS services using only your existing AWS credentials. Use it when a service already runs on AWS and you need a source-of-truth Spec Hub specification that Postman onboarding can turn into deterministic collections, OpenAPI-backed contract checks, smoke tests, mocks, monitors, repo artifacts, and CI runs.

Part of the Postman Enterprise Automation Suite; the composite action's README has the full action-picker table.

You usually set just aws-region. Repo identity comes from CI automatically, providers are auto-detected by probing your IAM permissions, and repo-first resolution prefers existing specs before calling AWS. No GitHub token is required by this action; it is read-only against AWS APIs.

Region and Postman handoff

The first required choice is the AWS region. Set aws-region to the region that contains the API Gateway, AppSync, SNS, EventBridge, Lambda, SSM, or other provider resources you want to inspect. If the repo already contains a spec, the action can still resolve it before calling AWS, but AWS credentials must be valid because startup validates identity.

For the Postman side, use postman-resolve-service-token-action to mint the access token and team ID from a Postman service account PMAK, then pass this action's spec-path output into the composite onboarding action for spec import. If you call bootstrap directly for an org-mode workspace, use bootstrap's workspace-team-id input for workspace creation. Downstream Postman credential preflight accepts warn and enforce; do not configure a public opt-out.

Usage

jobs:
  onboard-from-aws:
    runs-on: ubuntu-latest
    permissions:
      id-token: write
      contents: write
      actions: write
    steps:
      - uses: actions/checkout@v7

      - uses: aws-actions/configure-aws-credentials@v6
        with:
          role-to-assume: arn:aws:iam::123456789012:role/postman-spec-discovery
          aws-region: us-east-1

      - id: postman_token
        uses: postman-cs/postman-resolve-service-token-action@v2
        with:
          postman-api-key: ${{ secrets.POSTMAN_SERVICE_ACCOUNT_API_KEY }}
          postman-region: us

      - id: resolve
        uses: postman-cs/postman-aws-spec-discovery-action@v3
        with:
          aws-region: us-east-1

      - uses: postman-cs/postman-api-onboarding-action@v3
        if: steps.resolve.outputs.resolution-status == 'resolved'
        with:
          postman-api-key: ${{ secrets.POSTMAN_SERVICE_ACCOUNT_API_KEY }}
          postman-access-token: ${{ steps.postman_token.outputs.token }}
          postman-team-id: ${{ steps.postman_token.outputs.team-id }}
          postman-region: us
          credential-preflight: warn
          project-name: ${{ steps.resolve.outputs.service-name }}
          spec-path: ${{ steps.resolve.outputs.spec-path }}

The resolved spec lands in discovered-specs/ and the step exposes spec-path, service-name, confidence, and provenance as outputs.

The id-token: write permission is for AWS OIDC role assumption through aws-actions/configure-aws-credentials. contents: write and actions: write match the downstream composite action's default artifact commit and generated-workflow behavior. This AWS discovery action itself does not write repository contents or request a GitHub token. See docs/providers.md for the minimum and full IAM policies.

For EU Postman data residency, set postman-region: eu on both the service-token and downstream Postman action steps.

Examples

Zero-config, region only

Providers are probed against your IAM permissions; anything your role cannot read is skipped for resolution and recorded as a typed probe denial in provenance.

- id: resolve
  uses: postman-cs/postman-aws-spec-discovery-action@v3
  with:
    aws-region: us-east-1

Known API Gateway ID

Bypass broad account discovery when you already know the gateway.

- id: resolve
  uses: postman-cs/postman-aws-spec-discovery-action@v3
  with:
    aws-region: us-east-1
    gateway-id: abc123def4

discover-many mode

Export specs from all discovered APIs across all available providers. mode is an environment-variable input (INPUT_MODE).

- id: discover
  uses: postman-cs/postman-aws-spec-discovery-action@v3
  env:
    INPUT_MODE: discover-many
  with:
    aws-region: us-east-1

Custom output directory

Write generated specs somewhere other than discovered-specs/. The path must resolve within the repository root.

- id: resolve
  uses: postman-cs/postman-aws-spec-discovery-action@v3
  with:
    aws-region: us-east-1
    output-dir: postman/specs

Chaining into Postman API onboarding

Feed the discovered spec straight into the onboarding composite via its spec-path input. The service-token action is the primary way to supply the Postman access token and team ID.

- id: postman_token
  uses: postman-cs/postman-resolve-service-token-action@v2
  with:
    postman-api-key: ${{ secrets.POSTMAN_SERVICE_ACCOUNT_API_KEY }}
    postman-region: us

- id: resolve
  uses: postman-cs/postman-aws-spec-discovery-action@v3
  with:
    aws-region: us-east-1

- uses: postman-cs/postman-api-onboarding-action@v3
  if: steps.resolve.outputs.resolution-status == 'resolved'
  with:
    postman-api-key: ${{ secrets.POSTMAN_SERVICE_ACCOUNT_API_KEY }}
    postman-access-token: ${{ steps.postman_token.outputs.token }}
    postman-team-id: ${{ steps.postman_token.outputs.team-id }}
    postman-region: us
    credential-preflight: warn
    project-name: ${{ steps.resolve.outputs.service-name }}
    spec-path: ${{ steps.resolve.outputs.spec-path }}

Chaining directly into workspace bootstrap

Use the bootstrap action directly when you only need workspace/spec/collection creation and do not want repo sync or Insights linking. For org-mode workspace creation, provide bootstrap's workspace-team-id from your configured Postman sub-team.

- id: postman_token
  uses: postman-cs/postman-resolve-service-token-action@v2
  with:
    postman-api-key: ${{ secrets.POSTMAN_SERVICE_ACCOUNT_API_KEY }}
    postman-region: us

- id: resolve
  uses: postman-cs/postman-aws-spec-discovery-action@v3
  with:
    aws-region: us-east-1

- uses: postman-cs/postman-bootstrap-action@v2
  if: steps.resolve.outputs.resolution-status == 'resolved'
  with:
    postman-api-key: ${{ secrets.POSTMAN_SERVICE_ACCOUNT_API_KEY }}
    postman-access-token: ${{ steps.postman_token.outputs.token }}
    workspace-team-id: ${{ vars.POSTMAN_WORKSPACE_TEAM_ID }}
    postman-region: us
    credential-preflight: enforce
    project-name: ${{ steps.resolve.outputs.service-name }}
    spec-path: ${{ steps.resolve.outputs.spec-path }}

Event-driven repos (SNS contracts)

For event-driven repositories using SNS, keep your contract in-repo as AsyncAPI or JSON Schema and let the action resolve it automatically. The action detects SNS usage from IaC files and resolves durable event contracts instead of exporting an AWS-generated spec.

- id: resolve-events
  uses: postman-cs/postman-aws-spec-discovery-action@v3
  env:
    INPUT_MODE: resolve-one
    INPUT_EXPECTED_SERVICE_NAME: orders-events
  with:
    aws-region: us-east-1

See docs/sns-contract-resolution.md for the full precedence chain, sidecars, and edge cases.

GitLab and other CI (portable CLI)

node dist/cli.cjs \
  --aws-region us-east-1 \
  --repo-root "$CI_PROJECT_DIR" \
  --result-json "$CI_PROJECT_DIR/postman-aws-spec-discovery-result.json" \
  --dotenv-path "$CI_PROJECT_DIR/postman-aws-spec-discovery.env"

CLI environment-variable outputs are documented in docs/providers.md.

Inputs

NameDescriptionRequiredDefault
aws-regionAWS region used to resolve API Gateway, AppSync, SNS, EventBridge, Lambda, and other discovery providers.yesn/a
gateway-idOptional known API Gateway ID for this service. Use this when you want to bypass broader account discovery.non/a
stageOptional API Gateway stage override (for example prod or staging).non/a
expected-account-idOptional AWS account ID that must match sts:GetCallerIdentity before export. Mismatch fails closed with a sanitized error.non/a
expected-partitionOptional AWS partition (aws, aws-us-gov, or aws-cn) that must match the caller identity ARN before export. Mismatch fails closed with a sanitized error.non/a
expected-regionOptional AWS region that must exactly match aws-region before discovery or export. Mismatch fails closed.non/a
spec-pathOptional explicit path to a repository specification relative to repo-root. When set, resolution uses this contract and skips same-tier auto-selection.non/a
service-rootOptional monorepo service root relative to repo-root. Scopes Backstage entities and repository contract inventory to that directory.non/a
remote-fetch-allowlist-jsonOptional JSON array of exact remote-fetch allowlist entries ({"hostname","pathPrefix"} or {"host","path"}). Absent or empty denies all remote spec fetches (Backstage, SSM, SNS).non/a
terraform-state-paths-jsonOptional JSON array of repo-relative local Terraform state/output artifact paths (for example terraform.tfstate). Default []. .tfstate is never auto-discovered; only listed paths are read. Remote Terraform state remains forbidden.no[]
output-dirDirectory under the repository root where generated specs are written.nodiscovered-specs
postman-api-keyOptional service-account PMAK used to mint or re-mint a postman-access-token for telemetry enrichment (account_type). Not used for any AWS or Postman asset operation.non/a
postman-access-tokenOptional Postman service-account access token, used only to enrich anonymous telemetry with the session account_type. When omitted, postman-api-key alone can mint one for the same purpose. Not used for any AWS or Postman asset operation.non/a

Optional resolution tuning inputs (mode, expected-service-name, api-filter, max-candidates, repo context overrides, and more) are set via INPUT_-prefixed environment variables and documented in docs/providers.md.

Outputs

NameDescription
resolution-jsonJSON resolution result describing status, source type, confidence, and evidence.
resolution-statusResolution status: resolved or unresolved.
source-typeResolved source type: repo-spec, gateway-export, appsync-schema, appsync-event-api, eventbridge-schema, eventbridge-surface, cfn-embedded, glue-schema, bedrock-action-group, alb-listener-rule, sns-contract, ssm-registry, lambda-url-export, lambda-event-source, verified-permissions-schema, step-functions-asl, manual-review, or discover-many.
mapping-confidenceNumeric confidence score for selected service candidate.
spec-pathPath to resolved or generated specification when available.
spec-files-jsonOptional single-line JSON inventory of authoritative multi-file definition members (schemaVersion 1). Empty for single-file results, unresolved runs, discover-many top-level outputs, derived OpenAPI, and deterministic GraphQL/Smithy composition.
gateway-idResolved API Gateway ID when available.
service-nameResolved service name.
services-jsonLegacy discover-many output: JSON array of exported services.
service-countLegacy discover-many output: number of exported services.
export-summary-jsondiscover-many summary JSON with attempted/exported/failed/skipped counts.
candidates-jsonJSON array of top candidates when resolution is ambiguous.
provider-typeProvider that resolved the spec: api-gateway, appsync, appsync-events, eventbridge-schemas, eventbridge, cloudformation, glue, bedrock-action-group, alb-listener-rule, sns, ssm, lambda-url, lambda-event-source, verified-permissions, or step-functions.
spec-formatFormat of the resolved spec: openapi-yaml, openapi-json, graphql-sdl, graphql-introspection-json, asyncapi-yaml, asyncapi-json, json-schema, postman-collection, smithy, avro, protobuf, wsdl, or mcp-json.
contract-originSNS contract provenance when available: repo-asyncapi, repo-json-schema, generated-asyncapi, ssm-content, ssm-url, catalog-url, eventbridge-derived, code-derived, or manual-review.
contract-metadata-pathPath to SNS resolution metadata sidecar when available.
variant-countNumber of SNS delivery variants discovered when available.
derived-openapi-pathPath to the canonical derived OpenAPI JSON sidecar when available.
derived-openapi-versionOpenAPI version of the derived sidecar when available.
derived-openapi-completenessDerived OpenAPI completeness: full or partial.
derived-openapi-formatFormat of the derived OpenAPI sidecar, currently openapi-json.
derived-openapi-evidence-jsonJSON array of evidence entries explaining derived OpenAPI quality and limitations.
narrowing-strategyProgressive narrowing tier applied to API Gateway candidates (iac-fingerprint, cfn-correlation, tag-prefilter, naming-heuristic), or none when no tier matched.

Supported providers

ProviderArtifactAuto-detected via
Repo-local specsOpenAPI, Swagger, GraphQL SDL, AsyncAPI, Postman, JSON Schema, Avro, protobuf, SmithyKnown spec paths
Backstage catalogLocal or remote catalog-info.yaml API definitionsRoot or nested catalog file
API Gateway (REST, HTTP, WebSocket)OpenAPI 3.0 export or synthesisIAM probe / explicit gateway ID
AppSync GraphQLGraphQL SDLIAM probe + .graphql files
AppSync EventsEvent API channel namespacesIAM probe
EventBridge Schema RegistryJSON Schema or OpenApi3 contentIAM probe + IaC references
EventBridge rules, pipes, API destinationsEvent patterns, filters, targetsIAM probe
CloudFormation embedded specsEmbedded or referenced OpenAPI bodyIAM probe
Glue Schema RegistryAvro, JSON Schema, or protobufIAM probe + IaC references
Bedrock Agent action groupsInline or S3 OpenAPI action group schemaIAM probe
ALB listener rulesHost/path/method/header/query conditionsIAM probe
SSM Parameter StoreStored content, fetched URL content, or pointerIAM probe for /postman/specs/
SNS topicsAsyncAPI / JSON Schema contracts plus sidecarsIAM probe + SNS IaC references + SSM fallback
Lambda Function URLsSynthesized function URL contractIAM probe + IaC references / URL pattern
Lambda event source mappingsMapping filters, source, target, batch settingsIAM probe
Verified Permissions schemasCedar schema metadataIAM probe
Step Functions ASLState machine definitionsIAM probe

Each provider is probed at startup; providers your role cannot read are skipped for resolution and recorded in providerProbes. Remote spec URLs are deny-by-default unless remote-fetch-allowlist-json exactly allowlists them. Per-provider artifacts, OpenAPI derivation, stage/tag contracts, and IAM policies are detailed in docs/providers.md. The enforceable support matrix is validation/SUPPORT_LEDGER.md.

How it works

flowchart TB
    CRED["credential preflight<br/>sts:GetCallerIdentity"] --> PROBE["provider probes<br/>API Gateway, AppSync,<br/>EventBridge, SNS, ..."]
    IAC["IaC / workflow / config scan<br/>service signals"] --> SCORE
    PROBE --> SCORE["candidate scoring<br/>confidence + narrowing"]
    SCORE --> EXPORT["best match exported<br/>to output-dir"]
    EXPORT --> OUT["spec-path / spec-url outputs<br/>feed onboarding or bootstrap"]

At startup the action validates credentials with sts:GetCallerIdentity (and optional expected-account-id / expected-partition fail-closed checks), probes each provider with a lightweight IAM read, and scans bounded IaC, workflow, and config files for service signals. Authored repository contracts (including JSON Schema, Avro, Smithy project closures, and GraphQL groups) win when unambiguous; use spec-path or service-root for monorepos. Exact repository tag correlation prefers postman:repo, then GithubOrg+GithubRepo, before naming heuristics. Static IaC extraction never executes build tools. Remote fetches are deny-by-default. Stage selection is evidence-safe and records deployed-stage versus latest-configuration. Ambiguous runs emit ranked candidates-json / manual-review rather than silent first-wins. Full details live in docs/providers.md; coverage is enforced by validation/SUPPORT_LEDGER.md.

SNS is handled as a contract resolver, since SNS has no native exportable spec. Contracts resolve through a 9-level precedence chain (repo-local AsyncAPI down to manual review), with subscription-aware enrichment and metadata/webhook sidecars. See docs/sns-contract-resolution.md.

Resources

Telemetry

The action sends one anonymous usage event per run (action name/version, outcome, coarse CI metadata; never secrets, spec content, or repo names). Discovery itself performs no Postman operation, so the event stays inert unless a POSTMAN_TEAM_ID environment variable attributes the run to a team; the optional postman-api-key / postman-access-token inputs only resolve the session account_type and never touch discovery. Disable with POSTMAN_ACTIONS_TELEMETRY=off or DO_NOT_TRACK=1; route events to your own collector with POSTMAN_ACTIONS_TELEMETRY_ENDPOINT.

License

MIT

Keywords

github-action

FAQs

Package last updated on 16 Sep 2026

Related posts