@cdktf-providers/community-terraform-providers-ignition
Version:
Prebuilt community-terraform-providers/ignition Provider for Terraform CDK (cdktf)
943 lines (942 loc) • 34.1 kB
JavaScript
// https://registry.terraform.io/providers/community-terraform-providers/ignition/2.5.1/docs/data-sources/file
// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function dataIgnitionFileContentToTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
return {
content: cdktf.stringToTerraform(struct.content),
mime: cdktf.stringToTerraform(struct.mime),
};
}
export function dataIgnitionFileContentToHclTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
const attrs = {
content: {
value: cdktf.stringToHclTerraform(struct.content),
isBlock: false,
type: "simple",
storageClassType: "string",
},
mime: {
value: cdktf.stringToHclTerraform(struct.mime),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
export class DataIgnitionFileContentOutputReference extends cdktf.ComplexObject {
isEmptyObject = false;
/**
* @param terraformResource The parent resource
* @param terraformAttribute The attribute on the parent resource this class is referencing
*/
constructor(terraformResource, terraformAttribute) {
super(terraformResource, terraformAttribute, false, 0);
}
get internalValue() {
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._content !== undefined) {
hasAnyValues = true;
internalValueResult.content = this._content;
}
if (this._mime !== undefined) {
hasAnyValues = true;
internalValueResult.mime = this._mime;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._content = undefined;
this._mime = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._content = value.content;
this._mime = value.mime;
}
}
// content - computed: false, optional: false, required: true
_content;
get content() {
return this.getStringAttribute('content');
}
set content(value) {
this._content = value;
}
// Temporarily expose input value. Use with caution.
get contentInput() {
return this._content;
}
// mime - computed: false, optional: true, required: false
_mime;
get mime() {
return this.getStringAttribute('mime');
}
set mime(value) {
this._mime = value;
}
resetMime() {
this._mime = undefined;
}
// Temporarily expose input value. Use with caution.
get mimeInput() {
return this._mime;
}
}
export function dataIgnitionFileContentsHttpHeadersToTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
return {
name: cdktf.stringToTerraform(struct.name),
value: cdktf.stringToTerraform(struct.value),
};
}
export function dataIgnitionFileContentsHttpHeadersToHclTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
const attrs = {
name: {
value: cdktf.stringToHclTerraform(struct.name),
isBlock: false,
type: "simple",
storageClassType: "string",
},
value: {
value: cdktf.stringToHclTerraform(struct.value),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
export class DataIgnitionFileContentsHttpHeadersOutputReference extends cdktf.ComplexObject {
isEmptyObject = false;
resolvableValue;
/**
* @param terraformResource The parent resource
* @param terraformAttribute The attribute on the parent resource this class is referencing
* @param complexObjectIndex the index of this item in the list
* @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index)
*/
constructor(terraformResource, terraformAttribute, complexObjectIndex, complexObjectIsFromSet) {
super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex);
}
get internalValue() {
if (this.resolvableValue) {
return this.resolvableValue;
}
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._name !== undefined) {
hasAnyValues = true;
internalValueResult.name = this._name;
}
if (this._value !== undefined) {
hasAnyValues = true;
internalValueResult.value = this._value;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this.resolvableValue = undefined;
this._name = undefined;
this._value = undefined;
}
else if (cdktf.Tokenization.isResolvable(value)) {
this.isEmptyObject = false;
this.resolvableValue = value;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this.resolvableValue = undefined;
this._name = value.name;
this._value = value.value;
}
}
// 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;
}
// value - computed: false, optional: false, required: true
_value;
get value() {
return this.getStringAttribute('value');
}
set value(value) {
this._value = value;
}
// Temporarily expose input value. Use with caution.
get valueInput() {
return this._value;
}
}
export class DataIgnitionFileContentsHttpHeadersList extends cdktf.ComplexList {
terraformResource;
terraformAttribute;
wrapsSet;
internalValue;
/**
* @param terraformResource The parent resource
* @param terraformAttribute The attribute on the parent resource this class is referencing
* @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index)
*/
constructor(terraformResource, terraformAttribute, wrapsSet) {
super(terraformResource, terraformAttribute, wrapsSet);
this.terraformResource = terraformResource;
this.terraformAttribute = terraformAttribute;
this.wrapsSet = wrapsSet;
}
/**
* @param index the index of the item to return
*/
get(index) {
return new DataIgnitionFileContentsHttpHeadersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet);
}
}
export function dataIgnitionFileContentsToTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
return {
compression: cdktf.stringToTerraform(struct.compression),
source: cdktf.stringToTerraform(struct.source),
verification: cdktf.stringToTerraform(struct.verification),
http_headers: cdktf.listMapper(dataIgnitionFileContentsHttpHeadersToTerraform, true)(struct.httpHeaders),
};
}
export function dataIgnitionFileContentsToHclTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
const attrs = {
compression: {
value: cdktf.stringToHclTerraform(struct.compression),
isBlock: false,
type: "simple",
storageClassType: "string",
},
source: {
value: cdktf.stringToHclTerraform(struct.source),
isBlock: false,
type: "simple",
storageClassType: "string",
},
verification: {
value: cdktf.stringToHclTerraform(struct.verification),
isBlock: false,
type: "simple",
storageClassType: "string",
},
http_headers: {
value: cdktf.listMapperHcl(dataIgnitionFileContentsHttpHeadersToHclTerraform, true)(struct.httpHeaders),
isBlock: true,
type: "list",
storageClassType: "DataIgnitionFileContentsHttpHeadersList",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
export class DataIgnitionFileContentsOutputReference extends cdktf.ComplexObject {
isEmptyObject = false;
/**
* @param terraformResource The parent resource
* @param terraformAttribute The attribute on the parent resource this class is referencing
*/
constructor(terraformResource, terraformAttribute) {
super(terraformResource, terraformAttribute, false, 0);
}
get internalValue() {
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._compression !== undefined) {
hasAnyValues = true;
internalValueResult.compression = this._compression;
}
if (this._source !== undefined) {
hasAnyValues = true;
internalValueResult.source = this._source;
}
if (this._verification !== undefined) {
hasAnyValues = true;
internalValueResult.verification = this._verification;
}
if (this._httpHeaders?.internalValue !== undefined) {
hasAnyValues = true;
internalValueResult.httpHeaders = this._httpHeaders?.internalValue;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._compression = undefined;
this._source = undefined;
this._verification = undefined;
this._httpHeaders.internalValue = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._compression = value.compression;
this._source = value.source;
this._verification = value.verification;
this._httpHeaders.internalValue = value.httpHeaders;
}
}
// compression - computed: false, optional: true, required: false
_compression;
get compression() {
return this.getStringAttribute('compression');
}
set compression(value) {
this._compression = value;
}
resetCompression() {
this._compression = undefined;
}
// Temporarily expose input value. Use with caution.
get compressionInput() {
return this._compression;
}
// source - computed: false, optional: false, required: true
_source;
get source() {
return this.getStringAttribute('source');
}
set source(value) {
this._source = value;
}
// Temporarily expose input value. Use with caution.
get sourceInput() {
return this._source;
}
// verification - computed: false, optional: true, required: false
_verification;
get verification() {
return this.getStringAttribute('verification');
}
set verification(value) {
this._verification = value;
}
resetVerification() {
this._verification = undefined;
}
// Temporarily expose input value. Use with caution.
get verificationInput() {
return this._verification;
}
// http_headers - computed: false, optional: true, required: false
_httpHeaders = new DataIgnitionFileContentsHttpHeadersList(this, "http_headers", false);
get httpHeaders() {
return this._httpHeaders;
}
putHttpHeaders(value) {
this._httpHeaders.internalValue = value;
}
resetHttpHeaders() {
this._httpHeaders.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get httpHeadersInput() {
return this._httpHeaders.internalValue;
}
}
export function dataIgnitionFileSourceHttpHeadersToTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
return {
name: cdktf.stringToTerraform(struct.name),
value: cdktf.stringToTerraform(struct.value),
};
}
export function dataIgnitionFileSourceHttpHeadersToHclTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
const attrs = {
name: {
value: cdktf.stringToHclTerraform(struct.name),
isBlock: false,
type: "simple",
storageClassType: "string",
},
value: {
value: cdktf.stringToHclTerraform(struct.value),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
export class DataIgnitionFileSourceHttpHeadersOutputReference extends cdktf.ComplexObject {
isEmptyObject = false;
resolvableValue;
/**
* @param terraformResource The parent resource
* @param terraformAttribute The attribute on the parent resource this class is referencing
* @param complexObjectIndex the index of this item in the list
* @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index)
*/
constructor(terraformResource, terraformAttribute, complexObjectIndex, complexObjectIsFromSet) {
super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex);
}
get internalValue() {
if (this.resolvableValue) {
return this.resolvableValue;
}
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._name !== undefined) {
hasAnyValues = true;
internalValueResult.name = this._name;
}
if (this._value !== undefined) {
hasAnyValues = true;
internalValueResult.value = this._value;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this.resolvableValue = undefined;
this._name = undefined;
this._value = undefined;
}
else if (cdktf.Tokenization.isResolvable(value)) {
this.isEmptyObject = false;
this.resolvableValue = value;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this.resolvableValue = undefined;
this._name = value.name;
this._value = value.value;
}
}
// 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;
}
// value - computed: false, optional: false, required: true
_value;
get value() {
return this.getStringAttribute('value');
}
set value(value) {
this._value = value;
}
// Temporarily expose input value. Use with caution.
get valueInput() {
return this._value;
}
}
export class DataIgnitionFileSourceHttpHeadersList extends cdktf.ComplexList {
terraformResource;
terraformAttribute;
wrapsSet;
internalValue;
/**
* @param terraformResource The parent resource
* @param terraformAttribute The attribute on the parent resource this class is referencing
* @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index)
*/
constructor(terraformResource, terraformAttribute, wrapsSet) {
super(terraformResource, terraformAttribute, wrapsSet);
this.terraformResource = terraformResource;
this.terraformAttribute = terraformAttribute;
this.wrapsSet = wrapsSet;
}
/**
* @param index the index of the item to return
*/
get(index) {
return new DataIgnitionFileSourceHttpHeadersOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet);
}
}
export function dataIgnitionFileSourceToTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
return {
compression: cdktf.stringToTerraform(struct.compression),
source: cdktf.stringToTerraform(struct.source),
verification: cdktf.stringToTerraform(struct.verification),
http_headers: cdktf.listMapper(dataIgnitionFileSourceHttpHeadersToTerraform, true)(struct.httpHeaders),
};
}
export function dataIgnitionFileSourceToHclTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
const attrs = {
compression: {
value: cdktf.stringToHclTerraform(struct.compression),
isBlock: false,
type: "simple",
storageClassType: "string",
},
source: {
value: cdktf.stringToHclTerraform(struct.source),
isBlock: false,
type: "simple",
storageClassType: "string",
},
verification: {
value: cdktf.stringToHclTerraform(struct.verification),
isBlock: false,
type: "simple",
storageClassType: "string",
},
http_headers: {
value: cdktf.listMapperHcl(dataIgnitionFileSourceHttpHeadersToHclTerraform, true)(struct.httpHeaders),
isBlock: true,
type: "list",
storageClassType: "DataIgnitionFileSourceHttpHeadersList",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
export class DataIgnitionFileSourceOutputReference extends cdktf.ComplexObject {
isEmptyObject = false;
/**
* @param terraformResource The parent resource
* @param terraformAttribute The attribute on the parent resource this class is referencing
*/
constructor(terraformResource, terraformAttribute) {
super(terraformResource, terraformAttribute, false, 0);
}
get internalValue() {
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._compression !== undefined) {
hasAnyValues = true;
internalValueResult.compression = this._compression;
}
if (this._source !== undefined) {
hasAnyValues = true;
internalValueResult.source = this._source;
}
if (this._verification !== undefined) {
hasAnyValues = true;
internalValueResult.verification = this._verification;
}
if (this._httpHeaders?.internalValue !== undefined) {
hasAnyValues = true;
internalValueResult.httpHeaders = this._httpHeaders?.internalValue;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._compression = undefined;
this._source = undefined;
this._verification = undefined;
this._httpHeaders.internalValue = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._compression = value.compression;
this._source = value.source;
this._verification = value.verification;
this._httpHeaders.internalValue = value.httpHeaders;
}
}
// compression - computed: false, optional: true, required: false
_compression;
get compression() {
return this.getStringAttribute('compression');
}
set compression(value) {
this._compression = value;
}
resetCompression() {
this._compression = undefined;
}
// Temporarily expose input value. Use with caution.
get compressionInput() {
return this._compression;
}
// source - computed: false, optional: false, required: true
_source;
get source() {
return this.getStringAttribute('source');
}
set source(value) {
this._source = value;
}
// Temporarily expose input value. Use with caution.
get sourceInput() {
return this._source;
}
// verification - computed: false, optional: true, required: false
_verification;
get verification() {
return this.getStringAttribute('verification');
}
set verification(value) {
this._verification = value;
}
resetVerification() {
this._verification = undefined;
}
// Temporarily expose input value. Use with caution.
get verificationInput() {
return this._verification;
}
// http_headers - computed: false, optional: true, required: false
_httpHeaders = new DataIgnitionFileSourceHttpHeadersList(this, "http_headers", false);
get httpHeaders() {
return this._httpHeaders;
}
putHttpHeaders(value) {
this._httpHeaders.internalValue = value;
}
resetHttpHeaders() {
this._httpHeaders.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get httpHeadersInput() {
return this._httpHeaders.internalValue;
}
}
/**
* Represents a {@link https://registry.terraform.io/providers/community-terraform-providers/ignition/2.5.1/docs/data-sources/file ignition_file}
*/
export class DataIgnitionFile extends cdktf.TerraformDataSource {
// =================
// STATIC PROPERTIES
// =================
static tfResourceType = "ignition_file";
// ==============
// STATIC Methods
// ==============
/**
* Generates CDKTF code for importing a DataIgnitionFile 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 DataIgnitionFile to import
* @param importFromId The id of the existing DataIgnitionFile that should be imported. Refer to the {@link https://registry.terraform.io/providers/community-terraform-providers/ignition/2.5.1/docs/data-sources/file#import import section} in the documentation of this resource for the id to use
* @param provider? Optional instance of the provider where the DataIgnitionFile to import is found
*/
static generateConfigForImport(scope, importToId, importFromId, provider) {
return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "ignition_file", importId: importFromId, provider });
}
// ===========
// INITIALIZER
// ===========
/**
* Create a new {@link https://registry.terraform.io/providers/community-terraform-providers/ignition/2.5.1/docs/data-sources/file ignition_file} 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 DataIgnitionFileConfig
*/
constructor(scope, id, config) {
super(scope, id, {
terraformResourceType: 'ignition_file',
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._gid = config.gid;
this._id = config.id;
this._mode = config.mode;
this._overwrite = config.overwrite;
this._path = config.path;
this._uid = config.uid;
this._content.internalValue = config.content;
this._contents.internalValue = config.contents;
this._source.internalValue = config.source;
}
// ==========
// ATTRIBUTES
// ==========
// gid - computed: false, optional: true, required: false
_gid;
get gid() {
return this.getNumberAttribute('gid');
}
set gid(value) {
this._gid = value;
}
resetGid() {
this._gid = undefined;
}
// Temporarily expose input value. Use with caution.
get gidInput() {
return this._gid;
}
// 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;
}
// mode - computed: false, optional: true, required: false
_mode;
get mode() {
return this.getNumberAttribute('mode');
}
set mode(value) {
this._mode = value;
}
resetMode() {
this._mode = undefined;
}
// Temporarily expose input value. Use with caution.
get modeInput() {
return this._mode;
}
// overwrite - computed: false, optional: true, required: false
_overwrite;
get overwrite() {
return this.getBooleanAttribute('overwrite');
}
set overwrite(value) {
this._overwrite = value;
}
resetOverwrite() {
this._overwrite = undefined;
}
// Temporarily expose input value. Use with caution.
get overwriteInput() {
return this._overwrite;
}
// path - computed: false, optional: false, required: true
_path;
get path() {
return this.getStringAttribute('path');
}
set path(value) {
this._path = value;
}
// Temporarily expose input value. Use with caution.
get pathInput() {
return this._path;
}
// rendered - computed: true, optional: false, required: false
get rendered() {
return this.getStringAttribute('rendered');
}
// 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;
}
// content - computed: false, optional: true, required: false
_content = new DataIgnitionFileContentOutputReference(this, "content");
get content() {
return this._content;
}
putContent(value) {
this._content.internalValue = value;
}
resetContent() {
this._content.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get contentInput() {
return this._content.internalValue;
}
// contents - computed: false, optional: true, required: false
_contents = new DataIgnitionFileContentsOutputReference(this, "contents");
get contents() {
return this._contents;
}
putContents(value) {
this._contents.internalValue = value;
}
resetContents() {
this._contents.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get contentsInput() {
return this._contents.internalValue;
}
// source - computed: false, optional: true, required: false
_source = new DataIgnitionFileSourceOutputReference(this, "source");
get source() {
return this._source;
}
putSource(value) {
this._source.internalValue = value;
}
resetSource() {
this._source.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get sourceInput() {
return this._source.internalValue;
}
// =========
// SYNTHESIS
// =========
synthesizeAttributes() {
return {
gid: cdktf.numberToTerraform(this._gid),
id: cdktf.stringToTerraform(this._id),
mode: cdktf.numberToTerraform(this._mode),
overwrite: cdktf.booleanToTerraform(this._overwrite),
path: cdktf.stringToTerraform(this._path),
uid: cdktf.numberToTerraform(this._uid),
content: dataIgnitionFileContentToTerraform(this._content.internalValue),
contents: dataIgnitionFileContentsToTerraform(this._contents.internalValue),
source: dataIgnitionFileSourceToTerraform(this._source.internalValue),
};
}
synthesizeHclAttributes() {
const attrs = {
gid: {
value: cdktf.numberToHclTerraform(this._gid),
isBlock: false,
type: "simple",
storageClassType: "number",
},
id: {
value: cdktf.stringToHclTerraform(this._id),
isBlock: false,
type: "simple",
storageClassType: "string",
},
mode: {
value: cdktf.numberToHclTerraform(this._mode),
isBlock: false,
type: "simple",
storageClassType: "number",
},
overwrite: {
value: cdktf.booleanToHclTerraform(this._overwrite),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
path: {
value: cdktf.stringToHclTerraform(this._path),
isBlock: false,
type: "simple",
storageClassType: "string",
},
uid: {
value: cdktf.numberToHclTerraform(this._uid),
isBlock: false,
type: "simple",
storageClassType: "number",
},
content: {
value: dataIgnitionFileContentToHclTerraform(this._content.internalValue),
isBlock: true,
type: "list",
storageClassType: "DataIgnitionFileContentList",
},
contents: {
value: dataIgnitionFileContentsToHclTerraform(this._contents.internalValue),
isBlock: true,
type: "list",
storageClassType: "DataIgnitionFileContentsList",
},
source: {
value: dataIgnitionFileSourceToHclTerraform(this._source.internalValue),
isBlock: true,
type: "list",
storageClassType: "DataIgnitionFileSourceList",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
}