UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

90 lines (89 loc) 3.26 kB
import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import type { CloudAssembly } from './cloud-assembly'; import type { MetadataEntryResult, SynthesisMessage } from './metadata'; /** * Artifact properties for CloudFormation stacks. */ export interface AwsCloudFormationStackProperties { /** * A file relative to the assembly root which contains the CloudFormation template for this stack. */ readonly templateFile: string; /** * Values for CloudFormation stack parameters that should be passed when the stack is deployed. */ readonly parameters?: { [id: string]: string; }; /** * The name to use for the CloudFormation stack. * @default - name derived from artifact ID */ readonly stackName?: string; /** * Whether to enable termination protection for this stack. * * @default false */ readonly terminationProtection?: boolean; } /** * Represents an artifact within a cloud assembly. */ export declare class CloudArtifact { readonly assembly: CloudAssembly; readonly id: string; /** * Read the metadata for the given artifact * * HISTORICAL OR PRIVATE USE ONLY * * This is publicly exposed as a static function for downstream libraries that * don't use the `CloudAssembly`/`CloudArtifact` API, yet still need to read * an artifact's metadata. * * 99% of consumers should just access `artifact.metadata`. */ static readMetadata(assemblyDirectory: string, x: cxschema.ArtifactManifest): Record<string, cxschema.MetadataEntry[]>; /** * Returns a subclass of `CloudArtifact` based on the artifact type defined in the artifact manifest. * * @param assembly - The cloud assembly from which to load the artifact * @param id - The artifact ID * @param artifact - The artifact manifest * @returns the `CloudArtifact` that matches the artifact type or `undefined` if it's an artifact type that is unrecognized by this module. */ static fromManifest(assembly: CloudAssembly, id: string, artifact: cxschema.ArtifactManifest): CloudArtifact | undefined; /** * The artifact's manifest */ readonly manifest: cxschema.ArtifactManifest; /** * The set of messages extracted from the artifact's metadata. */ readonly messages: SynthesisMessage[]; /** * Cache of resolved dependencies. */ private _deps?; protected constructor(assembly: CloudAssembly, id: string, manifest: cxschema.ArtifactManifest); /** * Returns the metadata associated with this Cloud Artifact */ get metadata(): Record<string, cxschema.MetadataEntry[]>; /** * Returns all the artifacts that this artifact depends on. */ get dependencies(): CloudArtifact[]; /** * @returns all the metadata entries of a specific type in this artifact. */ findMetadataByType(type: string): MetadataEntryResult[]; private renderMessages; /** * An identifier that shows where this artifact is located in the tree * of nested assemblies, based on their manifests. Defaults to the normal * id. Should only be used in user interfaces. */ get hierarchicalId(): string; }