@cdktf-providers/community-terraform-providers-ignition
Version:
Prebuilt community-terraform-providers/ignition Provider for Terraform CDK (cdktf)
202 lines (201 loc) • 7.14 kB
JavaScript
// https://registry.terraform.io/providers/community-terraform-providers/ignition/2.5.1/docs/data-sources/raid
// generated from terraform resource schema
import * as cdktf from 'cdktf';
/**
* Represents a {@link https://registry.terraform.io/providers/community-terraform-providers/ignition/2.5.1/docs/data-sources/raid ignition_raid}
*/
export class DataIgnitionRaid extends cdktf.TerraformDataSource {
// =================
// STATIC PROPERTIES
// =================
static tfResourceType = "ignition_raid";
// ==============
// STATIC Methods
// ==============
/**
* Generates CDKTF code for importing a DataIgnitionRaid 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 DataIgnitionRaid to import
* @param importFromId The id of the existing DataIgnitionRaid that should be imported. Refer to the {@link https://registry.terraform.io/providers/community-terraform-providers/ignition/2.5.1/docs/data-sources/raid#import import section} in the documentation of this resource for the id to use
* @param provider? Optional instance of the provider where the DataIgnitionRaid to import is found
*/
static generateConfigForImport(scope, importToId, importFromId, provider) {
return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "ignition_raid", importId: importFromId, provider });
}
// ===========
// INITIALIZER
// ===========
/**
* Create a new {@link https://registry.terraform.io/providers/community-terraform-providers/ignition/2.5.1/docs/data-sources/raid ignition_raid} Data Source
*
* @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 DataIgnitionRaidConfig
*/
constructor(scope, id, config) {
super(scope, id, {
terraformResourceType: 'ignition_raid',
terraformGeneratorMetadata: {
providerName: 'ignition',
providerVersion: '2.5.1',
providerVersionConstraint: '2.5.1'
},
provider: config.provider,
dependsOn: config.dependsOn,
count: config.count,
lifecycle: config.lifecycle,
provisioners: config.provisioners,
connection: config.connection,
forEach: config.forEach
});
this._devices = config.devices;
this._id = config.id;
this._level = config.level;
this._name = config.name;
this._options = config.options;
this._spares = config.spares;
}
// ==========
// ATTRIBUTES
// ==========
// devices - computed: false, optional: false, required: true
_devices;
get devices() {
return this.getListAttribute('devices');
}
set devices(value) {
this._devices = value;
}
// Temporarily expose input value. Use with caution.
get devicesInput() {
return this._devices;
}
// id - computed: true, optional: true, required: false
_id;
get id() {
return this.getStringAttribute('id');
}
set id(value) {
this._id = value;
}
resetId() {
this._id = undefined;
}
// Temporarily expose input value. Use with caution.
get idInput() {
return this._id;
}
// level - computed: false, optional: false, required: true
_level;
get level() {
return this.getStringAttribute('level');
}
set level(value) {
this._level = value;
}
// Temporarily expose input value. Use with caution.
get levelInput() {
return this._level;
}
// name - computed: false, optional: false, required: true
_name;
get name() {
return this.getStringAttribute('name');
}
set name(value) {
this._name = value;
}
// Temporarily expose input value. Use with caution.
get nameInput() {
return this._name;
}
// options - computed: false, optional: true, required: false
_options;
get options() {
return this.getListAttribute('options');
}
set options(value) {
this._options = value;
}
resetOptions() {
this._options = undefined;
}
// Temporarily expose input value. Use with caution.
get optionsInput() {
return this._options;
}
// rendered - computed: true, optional: false, required: false
get rendered() {
return this.getStringAttribute('rendered');
}
// spares - computed: false, optional: true, required: false
_spares;
get spares() {
return this.getNumberAttribute('spares');
}
set spares(value) {
this._spares = value;
}
resetSpares() {
this._spares = undefined;
}
// Temporarily expose input value. Use with caution.
get sparesInput() {
return this._spares;
}
// =========
// SYNTHESIS
// =========
synthesizeAttributes() {
return {
devices: cdktf.listMapper(cdktf.stringToTerraform, false)(this._devices),
id: cdktf.stringToTerraform(this._id),
level: cdktf.stringToTerraform(this._level),
name: cdktf.stringToTerraform(this._name),
options: cdktf.listMapper(cdktf.stringToTerraform, false)(this._options),
spares: cdktf.numberToTerraform(this._spares),
};
}
synthesizeHclAttributes() {
const attrs = {
devices: {
value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._devices),
isBlock: false,
type: "list",
storageClassType: "stringList",
},
id: {
value: cdktf.stringToHclTerraform(this._id),
isBlock: false,
type: "simple",
storageClassType: "string",
},
level: {
value: cdktf.stringToHclTerraform(this._level),
isBlock: false,
type: "simple",
storageClassType: "string",
},
name: {
value: cdktf.stringToHclTerraform(this._name),
isBlock: false,
type: "simple",
storageClassType: "string",
},
options: {
value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._options),
isBlock: false,
type: "list",
storageClassType: "stringList",
},
spares: {
value: cdktf.numberToHclTerraform(this._spares),
isBlock: false,
type: "simple",
storageClassType: "number",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
}