Skip to main content
TerraformStack is a unit of deployment. Each stack synthesizes into its own Terraform configuration.

Constructor

new TerraformStack(scope: Construct, id: string)

Properties

kind

readonly kind: string The kind of stack.

dependencies

readonly dependencies: TerraformStack[] List of stacks that this stack depends on.

stackName

readonly stackName: string The name of the stack.

Methods

static of()

static of(construct: IConstruct): TerraformStack
Returns the TerraformStack instance that contains the given construct.

getLogicalId()

getLogicalId(element: any): string
Returns the logical ID for a given element within the stack.

prepareStack()

prepareStack(): void
Performs preparation steps before synthesis.

synthesize()

synthesize(): void
Synthesizes the stack into a Terraform configuration.

toTerraform()

toTerraform(): any
Returns the Terraform JSON representation of the stack.

addDependency()

addDependency(stack: TerraformStack): void
Adds a dependency on another stack.

dependsOn()

dependsOn(stack: TerraformStack): boolean
Checks if this stack depends on another stack.

ensureBackendExists()

ensureBackendExists(): TerraformBackend
Ensures that a backend is defined for the stack.

allProviders()

allProviders(): TerraformProvider[]
Returns all providers defined in the stack.