CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-pulumi--pulumi

Pulumi's Node.js SDK for infrastructure-as-code platform that allows you to create, deploy, and manage infrastructure using familiar programming languages and tools.

85

1.02x
Overview
Eval results
Files

task.mdevals/scenario-7/

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.

Install with Tessl CLI

npx tessl i tessl/npm-pulumi--pulumi

tile.json