@cdktf-providers/rancher-file
Version:
Prebuilt rancher/file Provider for Terraform CDK (cdktf)
86 lines (85 loc) • 3.15 kB
JavaScript
// https://registry.terraform.io/providers/rancher/file/2.2.2/docs
// generated from terraform resource schema
import * as cdktf from 'cdktf';
/**
* Represents a {@link https://registry.terraform.io/providers/rancher/file/2.2.2/docs file}
*/
export class FileProvider extends cdktf.TerraformProvider {
// =================
// STATIC PROPERTIES
// =================
static tfResourceType = "file";
// ==============
// STATIC Methods
// ==============
/**
* Generates CDKTF code for importing a FileProvider 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 FileProvider to import
* @param importFromId The id of the existing FileProvider that should be imported. Refer to the {@link https://registry.terraform.io/providers/rancher/file/2.2.2/docs#import import section} in the documentation of this resource for the id to use
* @param provider? Optional instance of the provider where the FileProvider to import is found
*/
static generateConfigForImport(scope, importToId, importFromId, provider) {
return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "file", importId: importFromId, provider });
}
// ===========
// INITIALIZER
// ===========
/**
* Create a new {@link https://registry.terraform.io/providers/rancher/file/2.2.2/docs file} 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 FileProviderConfig = {}
*/
constructor(scope, id, config = {}) {
super(scope, id, {
terraformResourceType: 'file',
terraformGeneratorMetadata: {
providerName: 'file',
providerVersion: '2.2.2',
providerVersionConstraint: '2.2.2'
},
terraformProviderSource: 'rancher/file'
});
this._alias = config.alias;
}
// ==========
// ATTRIBUTES
// ==========
// 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 {
alias: cdktf.stringToTerraform(this._alias),
};
}
synthesizeHclAttributes() {
const attrs = {
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));
}
}