@cdktf-providers/community-terraform-providers-ignition
Version:
Prebuilt community-terraform-providers/ignition Provider for Terraform CDK (cdktf)
392 lines (391 loc) • 13.4 kB
JavaScript
// https://registry.terraform.io/providers/community-terraform-providers/ignition/2.5.1/docs/data-sources/user
// 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/user ignition_user}
*/
export class DataIgnitionUser extends cdktf.TerraformDataSource {
// =================
// STATIC PROPERTIES
// =================
static tfResourceType = "ignition_user";
// ==============
// STATIC Methods
// ==============
/**
* Generates CDKTF code for importing a DataIgnitionUser 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 DataIgnitionUser to import
* @param importFromId The id of the existing DataIgnitionUser that should be imported. Refer to the {@link https://registry.terraform.io/providers/community-terraform-providers/ignition/2.5.1/docs/data-sources/user#import import section} in the documentation of this resource for the id to use
* @param provider? Optional instance of the provider where the DataIgnitionUser to import is found
*/
static generateConfigForImport(scope, importToId, importFromId, provider) {
return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "ignition_user", importId: importFromId, provider });
}
// ===========
// INITIALIZER
// ===========
/**
* Create a new {@link https://registry.terraform.io/providers/community-terraform-providers/ignition/2.5.1/docs/data-sources/user ignition_user} 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 DataIgnitionUserConfig
*/
constructor(scope, id, config) {
super(scope, id, {
terraformResourceType: 'ignition_user',
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._gecos = config.gecos;
this._groups = config.groups;
this._homeDir = config.homeDir;
this._id = config.id;
this._name = config.name;
this._noCreateHome = config.noCreateHome;
this._noLogInit = config.noLogInit;
this._noUserGroup = config.noUserGroup;
this._passwordHash = config.passwordHash;
this._primaryGroup = config.primaryGroup;
this._shell = config.shell;
this._sshAuthorizedKeys = config.sshAuthorizedKeys;
this._system = config.systemAttribute;
this._uid = config.uid;
}
// ==========
// ATTRIBUTES
// ==========
// gecos - computed: false, optional: true, required: false
_gecos;
get gecos() {
return this.getStringAttribute('gecos');
}
set gecos(value) {
this._gecos = value;
}
resetGecos() {
this._gecos = undefined;
}
// Temporarily expose input value. Use with caution.
get gecosInput() {
return this._gecos;
}
// groups - computed: false, optional: true, required: false
_groups;
get groups() {
return this.getListAttribute('groups');
}
set groups(value) {
this._groups = value;
}
resetGroups() {
this._groups = undefined;
}
// Temporarily expose input value. Use with caution.
get groupsInput() {
return this._groups;
}
// home_dir - computed: false, optional: true, required: false
_homeDir;
get homeDir() {
return this.getStringAttribute('home_dir');
}
set homeDir(value) {
this._homeDir = value;
}
resetHomeDir() {
this._homeDir = undefined;
}
// Temporarily expose input value. Use with caution.
get homeDirInput() {
return this._homeDir;
}
// 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;
}
// 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;
}
// no_create_home - computed: false, optional: true, required: false
_noCreateHome;
get noCreateHome() {
return this.getBooleanAttribute('no_create_home');
}
set noCreateHome(value) {
this._noCreateHome = value;
}
resetNoCreateHome() {
this._noCreateHome = undefined;
}
// Temporarily expose input value. Use with caution.
get noCreateHomeInput() {
return this._noCreateHome;
}
// no_log_init - computed: false, optional: true, required: false
_noLogInit;
get noLogInit() {
return this.getBooleanAttribute('no_log_init');
}
set noLogInit(value) {
this._noLogInit = value;
}
resetNoLogInit() {
this._noLogInit = undefined;
}
// Temporarily expose input value. Use with caution.
get noLogInitInput() {
return this._noLogInit;
}
// no_user_group - computed: false, optional: true, required: false
_noUserGroup;
get noUserGroup() {
return this.getBooleanAttribute('no_user_group');
}
set noUserGroup(value) {
this._noUserGroup = value;
}
resetNoUserGroup() {
this._noUserGroup = undefined;
}
// Temporarily expose input value. Use with caution.
get noUserGroupInput() {
return this._noUserGroup;
}
// password_hash - computed: false, optional: true, required: false
_passwordHash;
get passwordHash() {
return this.getStringAttribute('password_hash');
}
set passwordHash(value) {
this._passwordHash = value;
}
resetPasswordHash() {
this._passwordHash = undefined;
}
// Temporarily expose input value. Use with caution.
get passwordHashInput() {
return this._passwordHash;
}
// primary_group - computed: false, optional: true, required: false
_primaryGroup;
get primaryGroup() {
return this.getStringAttribute('primary_group');
}
set primaryGroup(value) {
this._primaryGroup = value;
}
resetPrimaryGroup() {
this._primaryGroup = undefined;
}
// Temporarily expose input value. Use with caution.
get primaryGroupInput() {
return this._primaryGroup;
}
// rendered - computed: true, optional: false, required: false
get rendered() {
return this.getStringAttribute('rendered');
}
// shell - computed: false, optional: true, required: false
_shell;
get shell() {
return this.getStringAttribute('shell');
}
set shell(value) {
this._shell = value;
}
resetShell() {
this._shell = undefined;
}
// Temporarily expose input value. Use with caution.
get shellInput() {
return this._shell;
}
// ssh_authorized_keys - computed: false, optional: true, required: false
_sshAuthorizedKeys;
get sshAuthorizedKeys() {
return this.getListAttribute('ssh_authorized_keys');
}
set sshAuthorizedKeys(value) {
this._sshAuthorizedKeys = value;
}
resetSshAuthorizedKeys() {
this._sshAuthorizedKeys = undefined;
}
// Temporarily expose input value. Use with caution.
get sshAuthorizedKeysInput() {
return this._sshAuthorizedKeys;
}
// system - computed: false, optional: true, required: false
_system;
get systemAttribute() {
return this.getBooleanAttribute('system');
}
set systemAttribute(value) {
this._system = value;
}
resetSystemAttribute() {
this._system = undefined;
}
// Temporarily expose input value. Use with caution.
get systemAttributeInput() {
return this._system;
}
// uid - computed: false, optional: true, required: false
_uid;
get uid() {
return this.getNumberAttribute('uid');
}
set uid(value) {
this._uid = value;
}
resetUid() {
this._uid = undefined;
}
// Temporarily expose input value. Use with caution.
get uidInput() {
return this._uid;
}
// =========
// SYNTHESIS
// =========
synthesizeAttributes() {
return {
gecos: cdktf.stringToTerraform(this._gecos),
groups: cdktf.listMapper(cdktf.stringToTerraform, false)(this._groups),
home_dir: cdktf.stringToTerraform(this._homeDir),
id: cdktf.stringToTerraform(this._id),
name: cdktf.stringToTerraform(this._name),
no_create_home: cdktf.booleanToTerraform(this._noCreateHome),
no_log_init: cdktf.booleanToTerraform(this._noLogInit),
no_user_group: cdktf.booleanToTerraform(this._noUserGroup),
password_hash: cdktf.stringToTerraform(this._passwordHash),
primary_group: cdktf.stringToTerraform(this._primaryGroup),
shell: cdktf.stringToTerraform(this._shell),
ssh_authorized_keys: cdktf.listMapper(cdktf.stringToTerraform, false)(this._sshAuthorizedKeys),
system: cdktf.booleanToTerraform(this._system),
uid: cdktf.numberToTerraform(this._uid),
};
}
synthesizeHclAttributes() {
const attrs = {
gecos: {
value: cdktf.stringToHclTerraform(this._gecos),
isBlock: false,
type: "simple",
storageClassType: "string",
},
groups: {
value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._groups),
isBlock: false,
type: "list",
storageClassType: "stringList",
},
home_dir: {
value: cdktf.stringToHclTerraform(this._homeDir),
isBlock: false,
type: "simple",
storageClassType: "string",
},
id: {
value: cdktf.stringToHclTerraform(this._id),
isBlock: false,
type: "simple",
storageClassType: "string",
},
name: {
value: cdktf.stringToHclTerraform(this._name),
isBlock: false,
type: "simple",
storageClassType: "string",
},
no_create_home: {
value: cdktf.booleanToHclTerraform(this._noCreateHome),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
no_log_init: {
value: cdktf.booleanToHclTerraform(this._noLogInit),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
no_user_group: {
value: cdktf.booleanToHclTerraform(this._noUserGroup),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
password_hash: {
value: cdktf.stringToHclTerraform(this._passwordHash),
isBlock: false,
type: "simple",
storageClassType: "string",
},
primary_group: {
value: cdktf.stringToHclTerraform(this._primaryGroup),
isBlock: false,
type: "simple",
storageClassType: "string",
},
shell: {
value: cdktf.stringToHclTerraform(this._shell),
isBlock: false,
type: "simple",
storageClassType: "string",
},
ssh_authorized_keys: {
value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._sshAuthorizedKeys),
isBlock: false,
type: "list",
storageClassType: "stringList",
},
system: {
value: cdktf.booleanToHclTerraform(this._system),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
uid: {
value: cdktf.numberToHclTerraform(this._uid),
isBlock: false,
type: "simple",
storageClassType: "number",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
}