or run

npx @tessl/cli init
Log in

Version

Files

docs

asset-management.mdautomation.mdconfiguration.mddynamic-resources.mdindex.mdlogging-diagnostics.mdoutput-system.mdprovider-development.mdresource-management.mdruntime-operations.mdstack-references.mdutilities.md
tile.json

task.mdevals/scenario-5/

Graph-bound Connection Builder

Compose connection details from deferred stack values while keeping sensitive data protected and unknown values intact during previews.

Capabilities

Compose connection details

  • It assembles host, optional region prefix, database name, and optional port into a URI without inserting "undefined" segments; defaults port to 443 when omitted. @test

Sensitive credential propagation

  • When credentials are marked sensitive, the connection URI and credential bundle remain secret while a redacted summary exposes only non-sensitive fields. @test

Unknown value handling

  • When any input is unknown at preview time, the URI stays unknown instead of being coerced to placeholder strings, and secrecy is preserved on sensitive credentials. @test

Implementation

@generates

API

// GraphValue represents deferred stack values that may be secret or unknown.
export type GraphValue<T> = unknown;

export interface ConnectionInputs {
  host: GraphValue<string>;
  port?: GraphValue<number>;
  database: GraphValue<string>;
  region?: GraphValue<string | undefined>;
  credentials: {
    username: GraphValue<string>;
    password: GraphValue<string>;
    sensitive?: boolean;
  };
}

export interface ConnectionDetails {
  uri: GraphValue<string>;
  redacted: GraphValue<{
    host: string;
    port: number;
    database: string;
    region?: string;
    username: string;
  }>;
  credentials: GraphValue<{ username: string; password: string }>;
}

export function buildConnectionDetails(
  inputs: ConnectionInputs
): GraphValue<ConnectionDetails>;

Dependencies { .dependencies }

@pulumi/pulumi { .dependency }

Provides graph-aware values, combination helpers, and secret handling.