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