Skip to main content

OctoTerraformResourceScope <TResponse>

One octo resource's slice of the terraform module being generated.

Obtained from TerraformModuleScope.addOctoTerraformResource. Everything you emit through it is attributed to that octo resource, which is how Octo later maps a terraform plan entry, and a terraform output, back to the resource it belongs to.

@group

Resources

@see

ATerraformResource for where this is used.

Type parameters

Index

Methods

addTerraformResource

  • addTerraformResource(type: string, name: string, spec?: Record<string, unknown>, options?: { chain?: boolean }): TerraformResource
  • Emits one resource "<type>" "<name>" block for this octo resource. Multiple calls chain via depends_on in call order. The provider alias is applied automatically when the resource was registered with a provider context.

    Pass options.chain: false to keep a block out of the chain: it depends on neither the block before it nor is depended on by the block after it, and waits only on what its attributes reference. Use it for a block emitted once per item, like a file upload, where a chain would run the items one at a time and store every earlier address in each item's terraform state.


    Parameters

    • type: string
    • name: string
    • optionalspec: Record<string, unknown>
    • optionaloptions: { chain?: boolean }
      • optionalchain: boolean

    Returns TerraformResource

output

  • output(outputs: Record<keyof TResponse & string, unknown>, options?: { sensitiveKeys?: (keyof TResponse & string)[] }): void
  • Declares the outputs for this resource — one entry per response key. Every response key must be declared; the commit phase reads exactly these outputs to reconstruct the full response.


    Parameters

    • outputs: Record<keyof TResponse & string, unknown>
    • optionaloptions: { sensitiveKeys?: (keyof TResponse & string)[] }
      • optionalsensitiveKeys: (keyof TResponse & string)[]

    Returns void

Page Options