terraform-generator
Version:
Generate Terraform configurations with Node.js.
30 lines (29 loc) • 715 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Variable = void 0;
const arguments_1 = require("../arguments");
const _1 = require(".");
/**
* @category Block
*/
class Variable extends _1.Block {
/**
* Construct variable.
*
* Refer to Terraform documentation on what can be put as arguments.
*
* @param name name
* @param args arguments
*/
constructor(name, args) {
super('variable', [name], args);
this.name = name;
}
asArgument() {
return new arguments_1.Argument(`var.${this.name}`);
}
attr(name) {
return new arguments_1.Attribute(this, name);
}
}
exports.Variable = Variable;