terraform-generator
Version:
Generate Terraform configurations with Node.js.
30 lines (29 loc) • 713 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.attr = exports.Attribute = void 0;
const _1 = require(".");
/**
* @category Argument
*/
class Attribute extends _1.Argument {
/**
* Construct block's attribute.
*
* @param block block
* @param attrName attribute name
*/
constructor(block, attrName) {
super(`${block.asArgument().toTerraform()}.${attrName.trim()}`);
}
}
exports.Attribute = Attribute;
/**
* Convenient function to construct new block's [[Attribute]].
*
* @param block block
* @param name attribute name
*
* @category Argument
*/
const attr = (block, name) => new Attribute(block, name);
exports.attr = attr;