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-9/

Resource Transform Policy Helper

A helper that builds a small deployment while enforcing stack-level transformations for tagging, data lookups, and safe renames using the dependency package.

Capabilities

Merge default tags via transformations

  • When building the resources, apply a stack-wide transformation that merges defaults into each resource's tag/metadata map without overwriting explicit per-resource keys. Entries listed in skip must not be modified by the transformation. @test

Transform data-source invokes

  • Data-source lookups must flow through the same transformation pipeline so call arguments gain the defaults map unless callers provide those keys explicitly. @test

Preserve identity when renaming

  • If renameFrom is provided, the resource options must include an alias back to that previous name so the deployment updates in place instead of replacing the resource. @test

Implementation

@generates

buildStack should create one primary resource and run one data-source lookup using lookupArgs; both operations must be subject to the transformations described above, and the resulting names/outputs are returned in BuildResult.

API

export interface TransformConfig {
  defaults: Record<string, string>;
  skip?: string[];
  renameFrom?: string;
  lookupArgs: Record<string, unknown>;
}

export interface BuildResult {
  resourceName: string;
  resourceTags: Promise<Record<string, string>>;
  lookupResult: Promise<Record<string, unknown>>;
}

export function buildStack(config: TransformConfig): BuildResult;

Dependencies { .dependencies }

@pulumi/pulumi { .dependency }

Provides resource and invoke transformation hooks plus alias support needed for the helper.