terraform-generator
Version:
Generate Terraform configurations with Node.js.
56 lines (55 loc) • 1.64 kB
TypeScript
import { Argument, Attribute } from '../arguments';
import { TerraformArgs } from '../utils';
import { Block, Data, Provisioner } from '.';
/**
* @category Block
*/
export interface ResourceToDataOptions {
/**
* New type of the data source.
*/
type?: string;
/**
* New name of the data source.
*/
name?: string;
}
/**
* @category Block
*/
export declare class Resource extends Block {
readonly type: string;
readonly name: string;
/**
* Construct resource.
*
* Refer to Terraform documentation on what can be put as type & arguments.
*
* @param type type
* @param name name
* @param args arguments
* @param provisioners provisioners
*/
constructor(type: string, name: string, args?: TerraformArgs, provisioners?: Provisioner[]);
asArgument(): Argument;
attr(name: string): Attribute;
/**
* Get provisioners.
*/
getProvisioners(): Provisioner[];
/**
* Set provisioners.
*/
setProvisioners(provisioners: Provisioner[] | undefined): this;
/**
* Convert resource into data source.
*
* Refer to Terraform documentation on what can be put as arguments.
*
* @param options options
* @param argNames names of resource arguments to converted into data source arguments;
* use array for name mapping, position 0 = original resource's argument name, position 1 = mapped data source's argument name
* @param args extra arguments
*/
toData(options: ResourceToDataOptions | undefined, argNames: (string | [string, string])[], args?: TerraformArgs): Data;
}