@cdktf-providers/rancher-rke
Version:
Prebuilt rancher/rke Provider for Terraform CDK (cdktf)
132 lines (131 loc) • 4.49 kB
JavaScript
// https://registry.terraform.io/providers/rancher/rke/1.7.5/docs
// generated from terraform resource schema
import * as cdktf from 'cdktf';
/**
* Represents a {@link https://registry.terraform.io/providers/rancher/rke/1.7.5/docs rke}
*/
export class RkeProvider extends cdktf.TerraformProvider {
// =================
// STATIC PROPERTIES
// =================
static tfResourceType = "rke";
// ==============
// STATIC Methods
// ==============
/**
* Generates CDKTF code for importing a RkeProvider resource upon running "cdktf plan <stack-name>"
* @param scope The scope in which to define this construct
* @param importToId The construct id used in the generated config for the RkeProvider to import
* @param importFromId The id of the existing RkeProvider that should be imported. Refer to the {@link https://registry.terraform.io/providers/rancher/rke/1.7.5/docs#import import section} in the documentation of this resource for the id to use
* @param provider? Optional instance of the provider where the RkeProvider to import is found
*/
static generateConfigForImport(scope, importToId, importFromId, provider) {
return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "rke", importId: importFromId, provider });
}
// ===========
// INITIALIZER
// ===========
/**
* Create a new {@link https://registry.terraform.io/providers/rancher/rke/1.7.5/docs rke} Resource
*
* @param scope The scope in which to define this construct
* @param id The scoped construct ID. Must be unique amongst siblings in the same scope
* @param options RkeProviderConfig = {}
*/
constructor(scope, id, config = {}) {
super(scope, id, {
terraformResourceType: 'rke',
terraformGeneratorMetadata: {
providerName: 'rke',
providerVersion: '1.7.5',
providerVersionConstraint: '1.7.5'
},
terraformProviderSource: 'rancher/rke'
});
this._debug = config.debug;
this._logFile = config.logFile;
this._alias = config.alias;
}
// ==========
// ATTRIBUTES
// ==========
// debug - computed: false, optional: true, required: false
_debug;
get debug() {
return this._debug;
}
set debug(value) {
this._debug = value;
}
resetDebug() {
this._debug = undefined;
}
// Temporarily expose input value. Use with caution.
get debugInput() {
return this._debug;
}
// log_file - computed: false, optional: true, required: false
_logFile;
get logFile() {
return this._logFile;
}
set logFile(value) {
this._logFile = value;
}
resetLogFile() {
this._logFile = undefined;
}
// Temporarily expose input value. Use with caution.
get logFileInput() {
return this._logFile;
}
// alias - computed: false, optional: true, required: false
_alias;
get alias() {
return this._alias;
}
set alias(value) {
this._alias = value;
}
resetAlias() {
this._alias = undefined;
}
// Temporarily expose input value. Use with caution.
get aliasInput() {
return this._alias;
}
// =========
// SYNTHESIS
// =========
synthesizeAttributes() {
return {
debug: cdktf.booleanToTerraform(this._debug),
log_file: cdktf.stringToTerraform(this._logFile),
alias: cdktf.stringToTerraform(this._alias),
};
}
synthesizeHclAttributes() {
const attrs = {
debug: {
value: cdktf.booleanToHclTerraform(this._debug),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
log_file: {
value: cdktf.stringToHclTerraform(this._logFile),
isBlock: false,
type: "simple",
storageClassType: "string",
},
alias: {
value: cdktf.stringToHclTerraform(this._alias),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
}