@cdktf/provider-upcloud
Version:
Prebuilt upcloud Provider for Terraform CDK (cdktf)
1,279 lines • 213 kB
JavaScript
"use strict";
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ManagedDatabaseRedis = exports.ManagedDatabaseRedisPropertiesOutputReference = exports.ManagedDatabaseRedisPropertiesMigrationOutputReference = exports.ManagedDatabaseRedisNetworkList = exports.ManagedDatabaseRedisNetworkOutputReference = exports.ManagedDatabaseRedisNodeStatesList = exports.ManagedDatabaseRedisNodeStatesOutputReference = exports.ManagedDatabaseRedisComponentsList = exports.ManagedDatabaseRedisComponentsOutputReference = void 0;
exports.managedDatabaseRedisComponentsToTerraform = managedDatabaseRedisComponentsToTerraform;
exports.managedDatabaseRedisComponentsToHclTerraform = managedDatabaseRedisComponentsToHclTerraform;
exports.managedDatabaseRedisNodeStatesToTerraform = managedDatabaseRedisNodeStatesToTerraform;
exports.managedDatabaseRedisNodeStatesToHclTerraform = managedDatabaseRedisNodeStatesToHclTerraform;
exports.managedDatabaseRedisNetworkToTerraform = managedDatabaseRedisNetworkToTerraform;
exports.managedDatabaseRedisNetworkToHclTerraform = managedDatabaseRedisNetworkToHclTerraform;
exports.managedDatabaseRedisPropertiesMigrationToTerraform = managedDatabaseRedisPropertiesMigrationToTerraform;
exports.managedDatabaseRedisPropertiesMigrationToHclTerraform = managedDatabaseRedisPropertiesMigrationToHclTerraform;
exports.managedDatabaseRedisPropertiesToTerraform = managedDatabaseRedisPropertiesToTerraform;
exports.managedDatabaseRedisPropertiesToHclTerraform = managedDatabaseRedisPropertiesToHclTerraform;
const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
const cdktf = require("cdktf");
function managedDatabaseRedisComponentsToTerraform(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 {};
}
function managedDatabaseRedisComponentsToHclTerraform(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 = {};
return attrs;
}
class ManagedDatabaseRedisComponentsOutputReference extends cdktf.ComplexObject {
/**
* @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);
this.isEmptyObject = false;
}
get internalValue() {
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
}
}
// component - computed: true, optional: false, required: false
get component() {
return this.getStringAttribute('component');
}
// host - computed: true, optional: false, required: false
get host() {
return this.getStringAttribute('host');
}
// port - computed: true, optional: false, required: false
get port() {
return this.getNumberAttribute('port');
}
// route - computed: true, optional: false, required: false
get route() {
return this.getStringAttribute('route');
}
// usage - computed: true, optional: false, required: false
get usage() {
return this.getStringAttribute('usage');
}
}
exports.ManagedDatabaseRedisComponentsOutputReference = ManagedDatabaseRedisComponentsOutputReference;
_a = JSII_RTTI_SYMBOL_1;
ManagedDatabaseRedisComponentsOutputReference[_a] = { fqn: "@cdktf/provider-upcloud.managedDatabaseRedis.ManagedDatabaseRedisComponentsOutputReference", version: "15.1.3" };
class ManagedDatabaseRedisComponentsList extends cdktf.ComplexList {
/**
* @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 ManagedDatabaseRedisComponentsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet);
}
}
exports.ManagedDatabaseRedisComponentsList = ManagedDatabaseRedisComponentsList;
_b = JSII_RTTI_SYMBOL_1;
ManagedDatabaseRedisComponentsList[_b] = { fqn: "@cdktf/provider-upcloud.managedDatabaseRedis.ManagedDatabaseRedisComponentsList", version: "15.1.3" };
function managedDatabaseRedisNodeStatesToTerraform(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 {};
}
function managedDatabaseRedisNodeStatesToHclTerraform(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 = {};
return attrs;
}
class ManagedDatabaseRedisNodeStatesOutputReference extends cdktf.ComplexObject {
/**
* @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);
this.isEmptyObject = false;
}
get internalValue() {
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
}
}
// name - computed: true, optional: false, required: false
get name() {
return this.getStringAttribute('name');
}
// role - computed: true, optional: false, required: false
get role() {
return this.getStringAttribute('role');
}
// state - computed: true, optional: false, required: false
get state() {
return this.getStringAttribute('state');
}
}
exports.ManagedDatabaseRedisNodeStatesOutputReference = ManagedDatabaseRedisNodeStatesOutputReference;
_c = JSII_RTTI_SYMBOL_1;
ManagedDatabaseRedisNodeStatesOutputReference[_c] = { fqn: "@cdktf/provider-upcloud.managedDatabaseRedis.ManagedDatabaseRedisNodeStatesOutputReference", version: "15.1.3" };
class ManagedDatabaseRedisNodeStatesList extends cdktf.ComplexList {
/**
* @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 ManagedDatabaseRedisNodeStatesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet);
}
}
exports.ManagedDatabaseRedisNodeStatesList = ManagedDatabaseRedisNodeStatesList;
_d = JSII_RTTI_SYMBOL_1;
ManagedDatabaseRedisNodeStatesList[_d] = { fqn: "@cdktf/provider-upcloud.managedDatabaseRedis.ManagedDatabaseRedisNodeStatesList", version: "15.1.3" };
function managedDatabaseRedisNetworkToTerraform(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 {
family: cdktf.stringToTerraform(struct.family),
name: cdktf.stringToTerraform(struct.name),
type: cdktf.stringToTerraform(struct.type),
uuid: cdktf.stringToTerraform(struct.uuid),
};
}
function managedDatabaseRedisNetworkToHclTerraform(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 = {
family: {
value: cdktf.stringToHclTerraform(struct.family),
isBlock: false,
type: "simple",
storageClassType: "string",
},
name: {
value: cdktf.stringToHclTerraform(struct.name),
isBlock: false,
type: "simple",
storageClassType: "string",
},
type: {
value: cdktf.stringToHclTerraform(struct.type),
isBlock: false,
type: "simple",
storageClassType: "string",
},
uuid: {
value: cdktf.stringToHclTerraform(struct.uuid),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class ManagedDatabaseRedisNetworkOutputReference extends cdktf.ComplexObject {
/**
* @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);
this.isEmptyObject = false;
}
get internalValue() {
if (this.resolvableValue) {
return this.resolvableValue;
}
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._family !== undefined) {
hasAnyValues = true;
internalValueResult.family = this._family;
}
if (this._name !== undefined) {
hasAnyValues = true;
internalValueResult.name = this._name;
}
if (this._type !== undefined) {
hasAnyValues = true;
internalValueResult.type = this._type;
}
if (this._uuid !== undefined) {
hasAnyValues = true;
internalValueResult.uuid = this._uuid;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this.resolvableValue = undefined;
this._family = undefined;
this._name = undefined;
this._type = undefined;
this._uuid = 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._family = value.family;
this._name = value.name;
this._type = value.type;
this._uuid = value.uuid;
}
}
get family() {
return this.getStringAttribute('family');
}
set family(value) {
this._family = value;
}
// Temporarily expose input value. Use with caution.
get familyInput() {
return this._family;
}
get name() {
return this.getStringAttribute('name');
}
set name(value) {
this._name = value;
}
// Temporarily expose input value. Use with caution.
get nameInput() {
return this._name;
}
get type() {
return this.getStringAttribute('type');
}
set type(value) {
this._type = value;
}
// Temporarily expose input value. Use with caution.
get typeInput() {
return this._type;
}
get uuid() {
return this.getStringAttribute('uuid');
}
set uuid(value) {
this._uuid = value;
}
// Temporarily expose input value. Use with caution.
get uuidInput() {
return this._uuid;
}
}
exports.ManagedDatabaseRedisNetworkOutputReference = ManagedDatabaseRedisNetworkOutputReference;
_e = JSII_RTTI_SYMBOL_1;
ManagedDatabaseRedisNetworkOutputReference[_e] = { fqn: "@cdktf/provider-upcloud.managedDatabaseRedis.ManagedDatabaseRedisNetworkOutputReference", version: "15.1.3" };
class ManagedDatabaseRedisNetworkList extends cdktf.ComplexList {
/**
* @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 ManagedDatabaseRedisNetworkOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet);
}
}
exports.ManagedDatabaseRedisNetworkList = ManagedDatabaseRedisNetworkList;
_f = JSII_RTTI_SYMBOL_1;
ManagedDatabaseRedisNetworkList[_f] = { fqn: "@cdktf/provider-upcloud.managedDatabaseRedis.ManagedDatabaseRedisNetworkList", version: "15.1.3" };
function managedDatabaseRedisPropertiesMigrationToTerraform(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 {
dbname: cdktf.stringToTerraform(struct.dbname),
host: cdktf.stringToTerraform(struct.host),
ignore_dbs: cdktf.stringToTerraform(struct.ignoreDbs),
ignore_roles: cdktf.stringToTerraform(struct.ignoreRoles),
method: cdktf.stringToTerraform(struct.method),
password: cdktf.stringToTerraform(struct.password),
port: cdktf.numberToTerraform(struct.port),
ssl: cdktf.booleanToTerraform(struct.ssl),
username: cdktf.stringToTerraform(struct.username),
};
}
function managedDatabaseRedisPropertiesMigrationToHclTerraform(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 = {
dbname: {
value: cdktf.stringToHclTerraform(struct.dbname),
isBlock: false,
type: "simple",
storageClassType: "string",
},
host: {
value: cdktf.stringToHclTerraform(struct.host),
isBlock: false,
type: "simple",
storageClassType: "string",
},
ignore_dbs: {
value: cdktf.stringToHclTerraform(struct.ignoreDbs),
isBlock: false,
type: "simple",
storageClassType: "string",
},
ignore_roles: {
value: cdktf.stringToHclTerraform(struct.ignoreRoles),
isBlock: false,
type: "simple",
storageClassType: "string",
},
method: {
value: cdktf.stringToHclTerraform(struct.method),
isBlock: false,
type: "simple",
storageClassType: "string",
},
password: {
value: cdktf.stringToHclTerraform(struct.password),
isBlock: false,
type: "simple",
storageClassType: "string",
},
port: {
value: cdktf.numberToHclTerraform(struct.port),
isBlock: false,
type: "simple",
storageClassType: "number",
},
ssl: {
value: cdktf.booleanToHclTerraform(struct.ssl),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
username: {
value: cdktf.stringToHclTerraform(struct.username),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class ManagedDatabaseRedisPropertiesMigrationOutputReference extends cdktf.ComplexObject {
/**
* @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);
this.isEmptyObject = false;
}
get internalValue() {
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._dbname !== undefined) {
hasAnyValues = true;
internalValueResult.dbname = this._dbname;
}
if (this._host !== undefined) {
hasAnyValues = true;
internalValueResult.host = this._host;
}
if (this._ignoreDbs !== undefined) {
hasAnyValues = true;
internalValueResult.ignoreDbs = this._ignoreDbs;
}
if (this._ignoreRoles !== undefined) {
hasAnyValues = true;
internalValueResult.ignoreRoles = this._ignoreRoles;
}
if (this._method !== undefined) {
hasAnyValues = true;
internalValueResult.method = this._method;
}
if (this._password !== undefined) {
hasAnyValues = true;
internalValueResult.password = this._password;
}
if (this._port !== undefined) {
hasAnyValues = true;
internalValueResult.port = this._port;
}
if (this._ssl !== undefined) {
hasAnyValues = true;
internalValueResult.ssl = this._ssl;
}
if (this._username !== undefined) {
hasAnyValues = true;
internalValueResult.username = this._username;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._dbname = undefined;
this._host = undefined;
this._ignoreDbs = undefined;
this._ignoreRoles = undefined;
this._method = undefined;
this._password = undefined;
this._port = undefined;
this._ssl = undefined;
this._username = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._dbname = value.dbname;
this._host = value.host;
this._ignoreDbs = value.ignoreDbs;
this._ignoreRoles = value.ignoreRoles;
this._method = value.method;
this._password = value.password;
this._port = value.port;
this._ssl = value.ssl;
this._username = value.username;
}
}
get dbname() {
return this.getStringAttribute('dbname');
}
set dbname(value) {
this._dbname = value;
}
resetDbname() {
this._dbname = undefined;
}
// Temporarily expose input value. Use with caution.
get dbnameInput() {
return this._dbname;
}
get host() {
return this.getStringAttribute('host');
}
set host(value) {
this._host = value;
}
resetHost() {
this._host = undefined;
}
// Temporarily expose input value. Use with caution.
get hostInput() {
return this._host;
}
get ignoreDbs() {
return this.getStringAttribute('ignore_dbs');
}
set ignoreDbs(value) {
this._ignoreDbs = value;
}
resetIgnoreDbs() {
this._ignoreDbs = undefined;
}
// Temporarily expose input value. Use with caution.
get ignoreDbsInput() {
return this._ignoreDbs;
}
get ignoreRoles() {
return this.getStringAttribute('ignore_roles');
}
set ignoreRoles(value) {
this._ignoreRoles = value;
}
resetIgnoreRoles() {
this._ignoreRoles = undefined;
}
// Temporarily expose input value. Use with caution.
get ignoreRolesInput() {
return this._ignoreRoles;
}
get method() {
return this.getStringAttribute('method');
}
set method(value) {
this._method = value;
}
resetMethod() {
this._method = undefined;
}
// Temporarily expose input value. Use with caution.
get methodInput() {
return this._method;
}
get password() {
return this.getStringAttribute('password');
}
set password(value) {
this._password = value;
}
resetPassword() {
this._password = undefined;
}
// Temporarily expose input value. Use with caution.
get passwordInput() {
return this._password;
}
get port() {
return this.getNumberAttribute('port');
}
set port(value) {
this._port = value;
}
resetPort() {
this._port = undefined;
}
// Temporarily expose input value. Use with caution.
get portInput() {
return this._port;
}
get ssl() {
return this.getBooleanAttribute('ssl');
}
set ssl(value) {
this._ssl = value;
}
resetSsl() {
this._ssl = undefined;
}
// Temporarily expose input value. Use with caution.
get sslInput() {
return this._ssl;
}
get username() {
return this.getStringAttribute('username');
}
set username(value) {
this._username = value;
}
resetUsername() {
this._username = undefined;
}
// Temporarily expose input value. Use with caution.
get usernameInput() {
return this._username;
}
}
exports.ManagedDatabaseRedisPropertiesMigrationOutputReference = ManagedDatabaseRedisPropertiesMigrationOutputReference;
_g = JSII_RTTI_SYMBOL_1;
ManagedDatabaseRedisPropertiesMigrationOutputReference[_g] = { fqn: "@cdktf/provider-upcloud.managedDatabaseRedis.ManagedDatabaseRedisPropertiesMigrationOutputReference", version: "15.1.3" };
function managedDatabaseRedisPropertiesToTerraform(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 {
automatic_utility_network_ip_filter: cdktf.booleanToTerraform(struct.automaticUtilityNetworkIpFilter),
backup_hour: cdktf.numberToTerraform(struct.backupHour),
backup_minute: cdktf.numberToTerraform(struct.backupMinute),
ip_filter: cdktf.listMapper(cdktf.stringToTerraform, false)(struct.ipFilter),
public_access: cdktf.booleanToTerraform(struct.publicAccess),
redis_acl_channels_default: cdktf.stringToTerraform(struct.redisAclChannelsDefault),
redis_io_threads: cdktf.numberToTerraform(struct.redisIoThreads),
redis_lfu_decay_time: cdktf.numberToTerraform(struct.redisLfuDecayTime),
redis_lfu_log_factor: cdktf.numberToTerraform(struct.redisLfuLogFactor),
redis_maxmemory_policy: cdktf.stringToTerraform(struct.redisMaxmemoryPolicy),
redis_notify_keyspace_events: cdktf.stringToTerraform(struct.redisNotifyKeyspaceEvents),
redis_number_of_databases: cdktf.numberToTerraform(struct.redisNumberOfDatabases),
redis_persistence: cdktf.stringToTerraform(struct.redisPersistence),
redis_pubsub_client_output_buffer_limit: cdktf.numberToTerraform(struct.redisPubsubClientOutputBufferLimit),
redis_ssl: cdktf.booleanToTerraform(struct.redisSsl),
redis_timeout: cdktf.numberToTerraform(struct.redisTimeout),
redis_version: cdktf.stringToTerraform(struct.redisVersion),
service_log: cdktf.booleanToTerraform(struct.serviceLog),
migration: managedDatabaseRedisPropertiesMigrationToTerraform(struct.migration),
};
}
function managedDatabaseRedisPropertiesToHclTerraform(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 = {
automatic_utility_network_ip_filter: {
value: cdktf.booleanToHclTerraform(struct.automaticUtilityNetworkIpFilter),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
backup_hour: {
value: cdktf.numberToHclTerraform(struct.backupHour),
isBlock: false,
type: "simple",
storageClassType: "number",
},
backup_minute: {
value: cdktf.numberToHclTerraform(struct.backupMinute),
isBlock: false,
type: "simple",
storageClassType: "number",
},
ip_filter: {
value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct.ipFilter),
isBlock: false,
type: "list",
storageClassType: "stringList",
},
public_access: {
value: cdktf.booleanToHclTerraform(struct.publicAccess),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
redis_acl_channels_default: {
value: cdktf.stringToHclTerraform(struct.redisAclChannelsDefault),
isBlock: false,
type: "simple",
storageClassType: "string",
},
redis_io_threads: {
value: cdktf.numberToHclTerraform(struct.redisIoThreads),
isBlock: false,
type: "simple",
storageClassType: "number",
},
redis_lfu_decay_time: {
value: cdktf.numberToHclTerraform(struct.redisLfuDecayTime),
isBlock: false,
type: "simple",
storageClassType: "number",
},
redis_lfu_log_factor: {
value: cdktf.numberToHclTerraform(struct.redisLfuLogFactor),
isBlock: false,
type: "simple",
storageClassType: "number",
},
redis_maxmemory_policy: {
value: cdktf.stringToHclTerraform(struct.redisMaxmemoryPolicy),
isBlock: false,
type: "simple",
storageClassType: "string",
},
redis_notify_keyspace_events: {
value: cdktf.stringToHclTerraform(struct.redisNotifyKeyspaceEvents),
isBlock: false,
type: "simple",
storageClassType: "string",
},
redis_number_of_databases: {
value: cdktf.numberToHclTerraform(struct.redisNumberOfDatabases),
isBlock: false,
type: "simple",
storageClassType: "number",
},
redis_persistence: {
value: cdktf.stringToHclTerraform(struct.redisPersistence),
isBlock: false,
type: "simple",
storageClassType: "string",
},
redis_pubsub_client_output_buffer_limit: {
value: cdktf.numberToHclTerraform(struct.redisPubsubClientOutputBufferLimit),
isBlock: false,
type: "simple",
storageClassType: "number",
},
redis_ssl: {
value: cdktf.booleanToHclTerraform(struct.redisSsl),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
redis_timeout: {
value: cdktf.numberToHclTerraform(struct.redisTimeout),
isBlock: false,
type: "simple",
storageClassType: "number",
},
redis_version: {
value: cdktf.stringToHclTerraform(struct.redisVersion),
isBlock: false,
type: "simple",
storageClassType: "string",
},
service_log: {
value: cdktf.booleanToHclTerraform(struct.serviceLog),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
migration: {
value: managedDatabaseRedisPropertiesMigrationToHclTerraform(struct.migration),
isBlock: true,
type: "list",
storageClassType: "ManagedDatabaseRedisPropertiesMigrationList",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class ManagedDatabaseRedisPropertiesOutputReference extends cdktf.ComplexObject {
/**
* @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);
this.isEmptyObject = false;
// migration - computed: false, optional: true, required: false
this._migration = new ManagedDatabaseRedisPropertiesMigrationOutputReference(this, "migration");
}
get internalValue() {
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._automaticUtilityNetworkIpFilter !== undefined) {
hasAnyValues = true;
internalValueResult.automaticUtilityNetworkIpFilter = this._automaticUtilityNetworkIpFilter;
}
if (this._backupHour !== undefined) {
hasAnyValues = true;
internalValueResult.backupHour = this._backupHour;
}
if (this._backupMinute !== undefined) {
hasAnyValues = true;
internalValueResult.backupMinute = this._backupMinute;
}
if (this._ipFilter !== undefined) {
hasAnyValues = true;
internalValueResult.ipFilter = this._ipFilter;
}
if (this._publicAccess !== undefined) {
hasAnyValues = true;
internalValueResult.publicAccess = this._publicAccess;
}
if (this._redisAclChannelsDefault !== undefined) {
hasAnyValues = true;
internalValueResult.redisAclChannelsDefault = this._redisAclChannelsDefault;
}
if (this._redisIoThreads !== undefined) {
hasAnyValues = true;
internalValueResult.redisIoThreads = this._redisIoThreads;
}
if (this._redisLfuDecayTime !== undefined) {
hasAnyValues = true;
internalValueResult.redisLfuDecayTime = this._redisLfuDecayTime;
}
if (this._redisLfuLogFactor !== undefined) {
hasAnyValues = true;
internalValueResult.redisLfuLogFactor = this._redisLfuLogFactor;
}
if (this._redisMaxmemoryPolicy !== undefined) {
hasAnyValues = true;
internalValueResult.redisMaxmemoryPolicy = this._redisMaxmemoryPolicy;
}
if (this._redisNotifyKeyspaceEvents !== undefined) {
hasAnyValues = true;
internalValueResult.redisNotifyKeyspaceEvents = this._redisNotifyKeyspaceEvents;
}
if (this._redisNumberOfDatabases !== undefined) {
hasAnyValues = true;
internalValueResult.redisNumberOfDatabases = this._redisNumberOfDatabases;
}
if (this._redisPersistence !== undefined) {
hasAnyValues = true;
internalValueResult.redisPersistence = this._redisPersistence;
}
if (this._redisPubsubClientOutputBufferLimit !== undefined) {
hasAnyValues = true;
internalValueResult.redisPubsubClientOutputBufferLimit = this._redisPubsubClientOutputBufferLimit;
}
if (this._redisSsl !== undefined) {
hasAnyValues = true;
internalValueResult.redisSsl = this._redisSsl;
}
if (this._redisTimeout !== undefined) {
hasAnyValues = true;
internalValueResult.redisTimeout = this._redisTimeout;
}
if (this._redisVersion !== undefined) {
hasAnyValues = true;
internalValueResult.redisVersion = this._redisVersion;
}
if (this._serviceLog !== undefined) {
hasAnyValues = true;
internalValueResult.serviceLog = this._serviceLog;
}
if (this._migration?.internalValue !== undefined) {
hasAnyValues = true;
internalValueResult.migration = this._migration?.internalValue;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._automaticUtilityNetworkIpFilter = undefined;
this._backupHour = undefined;
this._backupMinute = undefined;
this._ipFilter = undefined;
this._publicAccess = undefined;
this._redisAclChannelsDefault = undefined;
this._redisIoThreads = undefined;
this._redisLfuDecayTime = undefined;
this._redisLfuLogFactor = undefined;
this._redisMaxmemoryPolicy = undefined;
this._redisNotifyKeyspaceEvents = undefined;
this._redisNumberOfDatabases = undefined;
this._redisPersistence = undefined;
this._redisPubsubClientOutputBufferLimit = undefined;
this._redisSsl = undefined;
this._redisTimeout = undefined;
this._redisVersion = undefined;
this._serviceLog = undefined;
this._migration.internalValue = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._automaticUtilityNetworkIpFilter = value.automaticUtilityNetworkIpFilter;
this._backupHour = value.backupHour;
this._backupMinute = value.backupMinute;
this._ipFilter = value.ipFilter;
this._publicAccess = value.publicAccess;
this._redisAclChannelsDefault = value.redisAclChannelsDefault;
this._redisIoThreads = value.redisIoThreads;
this._redisLfuDecayTime = value.redisLfuDecayTime;
this._redisLfuLogFactor = value.redisLfuLogFactor;
this._redisMaxmemoryPolicy = value.redisMaxmemoryPolicy;
this._redisNotifyKeyspaceEvents = value.redisNotifyKeyspaceEvents;
this._redisNumberOfDatabases = value.redisNumberOfDatabases;
this._redisPersistence = value.redisPersistence;
this._redisPubsubClientOutputBufferLimit = value.redisPubsubClientOutputBufferLimit;
this._redisSsl = value.redisSsl;
this._redisTimeout = value.redisTimeout;
this._redisVersion = value.redisVersion;
this._serviceLog = value.serviceLog;
this._migration.internalValue = value.migration;
}
}
get automaticUtilityNetworkIpFilter() {
return this.getBooleanAttribute('automatic_utility_network_ip_filter');
}
set automaticUtilityNetworkIpFilter(value) {
this._automaticUtilityNetworkIpFilter = value;
}
resetAutomaticUtilityNetworkIpFilter() {
this._automaticUtilityNetworkIpFilter = undefined;
}
// Temporarily expose input value. Use with caution.
get automaticUtilityNetworkIpFilterInput() {
return this._automaticUtilityNetworkIpFilter;
}
get backupHour() {
return this.getNumberAttribute('backup_hour');
}
set backupHour(value) {
this._backupHour = value;
}
resetBackupHour() {
this._backupHour = undefined;
}
// Temporarily expose input value. Use with caution.
get backupHourInput() {
return this._backupHour;
}
get backupMinute() {
return this.getNumberAttribute('backup_minute');
}
set backupMinute(value) {
this._backupMinute = value;
}
resetBackupMinute() {
this._backupMinute = undefined;
}
// Temporarily expose input value. Use with caution.
get backupMinuteInput() {
return this._backupMinute;
}
get ipFilter() {
return this.getListAttribute('ip_filter');
}
set ipFilter(value) {
this._ipFilter = value;
}
resetIpFilter() {
this._ipFilter = undefined;
}
// Temporarily expose input value. Use with caution.
get ipFilterInput() {
return this._ipFilter;
}
get publicAccess() {
return this.getBooleanAttribute('public_access');
}
set publicAccess(value) {
this._publicAccess = value;
}
resetPublicAccess() {
this._publicAccess = undefined;
}
// Temporarily expose input value. Use with caution.
get publicAccessInput() {
return this._publicAccess;
}
get redisAclChannelsDefault() {
return this.getStringAttribute('redis_acl_channels_default');
}
set redisAclChannelsDefault(value) {
this._redisAclChannelsDefault = value;
}
resetRedisAclChannelsDefault() {
this._redisAclChannelsDefault = undefined;
}
// Temporarily expose input value. Use with caution.
get redisAclChannelsDefaultInput() {
return this._redisAclChannelsDefault;
}
get redisIoThreads() {
return this.getNumberAttribute('redis_io_threads');
}
set redisIoThreads(value) {
this._redisIoThreads = value;
}
resetRedisIoThreads() {
this._redisIoThreads = undefined;
}
// Temporarily expose input value. Use with caution.
get redisIoThreadsInput() {
return this._redisIoThreads;
}
get redisLfuDecayTime() {
return this.getNumberAttribute('redis_lfu_decay_time');
}
set redisLfuDecayTime(value) {
this._redisLfuDecayTime = value;
}
resetRedisLfuDecayTime() {
this._redisLfuDecayTime = undefined;
}
// Temporarily expose input value. Use with caution.
get redisLfuDecayTimeInput() {
return this._redisLfuDecayTime;
}
get redisLfuLogFactor() {
return this.getNumberAttribute('redis_lfu_log_factor');
}
set redisLfuLogFactor(value) {
this._redisLfuLogFactor = value;
}
resetRedisLfuLogFactor() {
this._redisLfuLogFactor = undefined;
}
// Temporarily expose input value. Use with caution.
get redisLfuLogFactorInput() {
return this._redisLfuLogFactor;
}
get redisMaxmemoryPolicy() {
return this.getStringAttribute('redis_maxmemory_policy');
}
set redisMaxmemoryPolicy(value) {
this._redisMaxmemoryPolicy = value;
}
resetRedisMaxmemoryPolicy() {
this._redisMaxmemoryPolicy = undefined;
}
// Temporarily expose input value. Use with caution.
get redisMaxmemoryPolicyInput() {
return this._redisMaxmemoryPolicy;
}
get redisNotifyKeyspaceEvents() {
return this.getStringAttribute('redis_notify_keyspace_events');
}
set redisNotifyKeyspaceEvents(value) {
this._redisNotifyKeyspaceEvents = value;
}
resetRedisNotifyKeyspaceEvents() {
this._redisNotifyKeyspaceEvents = undefined;
}
// Temporarily expose input value. Use with caution.
get redisNotifyKeyspaceEventsInput() {
return this._redisNotifyKeyspaceEvents;
}
get redisNumberOfDatabases() {
return this.getNumberAttribute('redis_number_of_databases');
}
set redisNumberOfDatabases(value) {
this._redisNumberOfDatabases = value;
}
resetRedisNumberOfDatabases() {
this._redisNumberOfDatabases = undefined;
}
// Temporarily expose input value. Use with caution.
get redisNumberOfDatabasesInput() {
return this._redisNumberOfDatabases;
}
get redisPersistence() {
return this.getStringAttribute('redis_persistence');
}
set redisPersistence(value) {
this._redisPersistence = value;
}
resetRedisPersistence() {
this._redisPersistence = undefined;
}
// Temporarily expose input value. Use with caution.
get redisPersistenceInput() {
return this._redisPersistence;
}
get redisPubsubClientOutputBufferLimit() {
return this.getNumberAttribute('redis_pubsub_client_output_buffer_limit');
}
set redisPubsubClientOutputBufferLimit(value) {
this._redisPubsubClientOutputBufferLimit = value;
}
resetRedisPubsubClientOutputBufferLimit() {
this._redisPubsubClientOutputBufferLimit = undefined;
}
// Temporarily expose input value. Use with caution.
get redisPubsubClientOutputBufferLimitInput() {
return this._redisPubsubClientOutputBufferLimit;
}
get redisSsl() {
return this.getBooleanAttribute('redis_ssl');
}
set redisSsl(value) {
this._redisSsl = value;
}
resetRedisSsl() {
this._redisSsl = undefined;
}
// Temporarily expose input value. Use with caution.
get redisSslInput() {
return this._redisSsl;
}
get redisTimeout() {
return this.getNumberAttribute('redis_timeout');
}
set redisTimeout(value) {
this._redisTimeout = value;
}
resetRedisTimeout() {
this._redisTimeout = undefined;
}
// Temporarily expose input value. Use with caution.
get redisTimeoutInput() {
return this._redisTimeout;
}
get redisVersion() {
return this.getStringAttribute('redis_version');
}
set redisVersion(value) {
this._redisVersion = value;
}
resetRedisVersion() {
this._redisVersion = undefined;
}
// Temporarily expose input value. Use with caution.
get redisVersionInput() {
return this._redisVersion;
}
get serviceLog() {
return this.getBooleanAttribute('service_log');
}
set serviceLog(value) {
this._serviceLog = value;
}
resetServiceLog() {
this._serviceLog = undefined;
}
// Temporarily expose input value. Use with caution.
get serviceLogInput() {
return this._serviceLog;
}
get migration() {
return this._migration;
}
putMigration(value) {
this._migration.internalValue = value;
}
resetMigration() {
this._migration.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get migrationInput() {
return this._migration.internalValue;
}
}
exports.ManagedDatabaseRedisPropertiesOutputReference = ManagedDatabaseRedisPropertiesOutputReference;
_h = JSII_RTTI_SYMBOL_1;
ManagedDatabaseRedisPropertiesOutputReference[_h] = { fqn: "@cdktf/provider-upcloud.managedDatabaseRedis.ManagedDatabaseRedisPropertiesOutputReference", version: "15.1.3" };
/**
* Represents a {@link https://registry.terraform.io/providers/upcloudltd/upcloud/5.23.3/docs/resources/managed_database_redis upcloud_managed_database_redis}
*/
class ManagedDatabaseRedis extends cdktf.TerraformResource {
// ==============
// STATIC Methods
// ==============
/**
* Generates CDKTF code for importing a ManagedDatabaseRedis 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 ManagedDatabaseRedis to import
* @param importFromId The id of the existing ManagedDatabaseRedis that should be imported. Refer to the {@link https://registry.terraform.io/providers/upcloudltd/upcloud/5.23.3/docs/resources/managed_database_redis#import import section} in the documentation of this resource for the id to use
* @param provider? Optional instance of the provider where the ManagedDatabaseRedis to import is found
*/
static generateConfigForImport(scope, importToId, importFromId, provider) {
return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "upcloud_managed_database_redis", importId: importFromId, provider });
}
// ===========
// INITIALIZER
// ===========
/**
* Create a new {@link https://registry.terraform.io/providers/upcloudltd/upcloud/5.23.3/docs/resources/managed_database_redis upcloud_managed_database_redis} 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 ManagedDatabaseRedisConfig
*/
constructor(scope, id, config) {
super(scope, id, {
terraformResourceType: 'upcloud_managed_database_redis',
terraformGeneratorMetadata: {
providerName: 'upcloud',
providerVersion: '5.23.3',
providerVersionConstraint: '~> 5.0'
},
provider: config.provider,
dependsOn: config.dependsOn,
count: config.count,
lifecycle: config.lifecycle,
provisioners: config.provisioners,
connection: config.connection,
forEach: config.forEach
});
// ==========
// ATTRIBUTES
// ==========
// components - computed: true, optional: false, required: false
this._components = new ManagedDatabaseRedisComponentsList(this, "components", false);
// node_states - computed: true, optional: false, required: false
this._nodeStates = new ManagedDatabaseRedisNodeStatesList(this, "node_states", false);
// network - computed: false, optional: true, required: false
this._network = new ManagedDatabaseRedisNetworkList(this, "network", true);
// properties - computed: false, optional: true, required: false
this._properties = new ManagedDatabaseRedisPropertiesOutputReference(this, "properties");
this._id = config.id;
this._labels = config.labels;
this._maintenanceWindowDow = config.maintenanceWindowDow;
this._maintenanceWindowTime = config.maintenanceWindowTime;
this._name = config.name;
this._plan = config.plan;
this._powered = config.powered;
this._terminationProtection = config.terminationProtection;
this._title = config.title;
this._zone = config.zone;
this._network.internalValue = config.network;
this._properties.internalValue = config.properties;
}
get components() {
return this._components;
}
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;
}
get labels() {
return this.getStringMapAttribute('labels');
}
set labels(value) {
this._labels = value;
}
resetLabels() {
this._labels = undefined;
}
// Temporarily expose input value. Use with caution.
get labelsInput() {