terraform-generator
Version:
Generate Terraform configurations with Node.js.
34 lines (33 loc) • 886 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Provider = void 0;
const arguments_1 = require("../arguments");
const utils_1 = require("../utils");
const _1 = require(".");
/**
* @category Block
*/
class Provider extends _1.Block {
/**
* Construct provider.
*
* Refer to Terraform documentation on what can be put as type & arguments.
*
* @param type type
* @param args arguments
*/
constructor(type, args) {
super('provider', [type], args);
this.type = type;
}
asArgument() {
if (this.getArgument('alias')) {
return new arguments_1.Argument(`${this.type}.${this.getArgument('alias')}`);
}
throw new Error('Provider has no alias.');
}
attr(_name) {
throw utils_1.Util.inaccessibleMethod();
}
}
exports.Provider = Provider;