@cfxlabsinc/b2b-services
    Preparing search index...

    Interface ServiceRuntimeEnvArgs

    interface ServiceRuntimeEnvArgs {
        appName: string;
        cache?: ServiceValkeyInputs;
        db: Pick<
            ServiceDbInputs,
            "auroraDatabaseName"
            | "auroraProxyDefaultEndpoint",
        > & Partial<Pick<ServiceDbInputs, "auroraProxyReaderEndpoint">>;
        dbUser: string;
        maintenanceServiceId?: string | false;
        sentryProject: SentryProject;
        usesIdempotencyTable?: boolean;
        valkeyWorkloadName?: string;
    }
    Index
    appName: string

    Package name without the cfx- prefix, e.g. swap-api.

    Omit for a service with no cache identity — no VALKEY_* is emitted.

    db: Pick<ServiceDbInputs, "auroraDatabaseName" | "auroraProxyDefaultEndpoint"> & Partial<
        Pick<ServiceDbInputs, "auroraProxyReaderEndpoint">,
    >

    Only the fields this helper actually emits, so a caller may spread whatever it read off the cfx-db stack or pass a literal with just these. Deliberately excludes auroraProxyResourceId, which is for grantWorkloadDataAccess, not for a runtime env var — requiring it here would make every call site pass a value it does not use.

    auroraProxyReaderEndpoint is the optional third: passed, it is emitted as DB_RO_HOST for a workload that routes read paths onto the replica.

    dbUser: string

    The literal Postgres role, e.g. swap_api_rw.

    A plain string, never a reference to a resource: the matching AuroraWorkloadUser is declared in the cfx-db stack (only that stack runs in-VPC and can reach Aurora), so a reference here would be a cross-stack dependency on a resource this program cannot see. AuroraWorkloadUser echoes its workloadName back verbatim as the username, so the string and the role cannot disagree as long as they are spelled the same.

    maintenanceServiceId?: string | false

    MAINTENANCE_SERVICE_ID, defaulting to cfx-<appName>. Pass false for a function that is not independently maintenance-gated.

    sentryProject: SentryProject
    usesIdempotencyTable?: boolean

    Set IDEMPOTENCY_TABLE_NAME. Pair it with usesIdempotencyTable on the LambdaApp, which grants the DynamoDB access this name implies.

    valkeyWorkloadName?: string

    Valkey AUTH username, when it is not appName. A package that runs two functions off one bundle gives each its own cache identity, e.g. reward-events alongside reward-api.