@cdktf/provider-google
Version:
Prebuilt google Provider for Terraform CDK (cdktf)
1,157 lines • 209 kB
JavaScript
"use strict";
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AlloydbInstance = exports.AlloydbInstanceTimeoutsOutputReference = exports.alloydbInstanceTimeoutsToHclTerraform = exports.alloydbInstanceTimeoutsToTerraform = exports.AlloydbInstanceReadPoolConfigOutputReference = exports.alloydbInstanceReadPoolConfigToHclTerraform = exports.alloydbInstanceReadPoolConfigToTerraform = exports.AlloydbInstanceQueryInsightsConfigOutputReference = exports.alloydbInstanceQueryInsightsConfigToHclTerraform = exports.alloydbInstanceQueryInsightsConfigToTerraform = exports.AlloydbInstancePscInstanceConfigOutputReference = exports.alloydbInstancePscInstanceConfigToHclTerraform = exports.alloydbInstancePscInstanceConfigToTerraform = exports.AlloydbInstanceNetworkConfigOutputReference = exports.alloydbInstanceNetworkConfigToHclTerraform = exports.alloydbInstanceNetworkConfigToTerraform = exports.AlloydbInstanceNetworkConfigAuthorizedExternalNetworksList = exports.AlloydbInstanceNetworkConfigAuthorizedExternalNetworksOutputReference = exports.alloydbInstanceNetworkConfigAuthorizedExternalNetworksToHclTerraform = exports.alloydbInstanceNetworkConfigAuthorizedExternalNetworksToTerraform = exports.AlloydbInstanceMachineConfigOutputReference = exports.alloydbInstanceMachineConfigToHclTerraform = exports.alloydbInstanceMachineConfigToTerraform = exports.AlloydbInstanceClientConnectionConfigOutputReference = exports.alloydbInstanceClientConnectionConfigToHclTerraform = exports.alloydbInstanceClientConnectionConfigToTerraform = exports.AlloydbInstanceClientConnectionConfigSslConfigOutputReference = exports.alloydbInstanceClientConnectionConfigSslConfigToHclTerraform = exports.alloydbInstanceClientConnectionConfigSslConfigToTerraform = void 0;
const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
const cdktf = require("cdktf");
function alloydbInstanceClientConnectionConfigSslConfigToTerraform(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 {
ssl_mode: cdktf.stringToTerraform(struct.sslMode),
};
}
exports.alloydbInstanceClientConnectionConfigSslConfigToTerraform = alloydbInstanceClientConnectionConfigSslConfigToTerraform;
function alloydbInstanceClientConnectionConfigSslConfigToHclTerraform(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 = {
ssl_mode: {
value: cdktf.stringToHclTerraform(struct.sslMode),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.alloydbInstanceClientConnectionConfigSslConfigToHclTerraform = alloydbInstanceClientConnectionConfigSslConfigToHclTerraform;
class AlloydbInstanceClientConnectionConfigSslConfigOutputReference 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._sslMode !== undefined) {
hasAnyValues = true;
internalValueResult.sslMode = this._sslMode;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._sslMode = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._sslMode = value.sslMode;
}
}
get sslMode() {
return this.getStringAttribute('ssl_mode');
}
set sslMode(value) {
this._sslMode = value;
}
resetSslMode() {
this._sslMode = undefined;
}
// Temporarily expose input value. Use with caution.
get sslModeInput() {
return this._sslMode;
}
}
exports.AlloydbInstanceClientConnectionConfigSslConfigOutputReference = AlloydbInstanceClientConnectionConfigSslConfigOutputReference;
_a = JSII_RTTI_SYMBOL_1;
AlloydbInstanceClientConnectionConfigSslConfigOutputReference[_a] = { fqn: "@cdktf/provider-google.alloydbInstance.AlloydbInstanceClientConnectionConfigSslConfigOutputReference", version: "14.12.0" };
function alloydbInstanceClientConnectionConfigToTerraform(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 {
require_connectors: cdktf.booleanToTerraform(struct.requireConnectors),
ssl_config: alloydbInstanceClientConnectionConfigSslConfigToTerraform(struct.sslConfig),
};
}
exports.alloydbInstanceClientConnectionConfigToTerraform = alloydbInstanceClientConnectionConfigToTerraform;
function alloydbInstanceClientConnectionConfigToHclTerraform(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 = {
require_connectors: {
value: cdktf.booleanToHclTerraform(struct.requireConnectors),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
ssl_config: {
value: alloydbInstanceClientConnectionConfigSslConfigToHclTerraform(struct.sslConfig),
isBlock: true,
type: "list",
storageClassType: "AlloydbInstanceClientConnectionConfigSslConfigList",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.alloydbInstanceClientConnectionConfigToHclTerraform = alloydbInstanceClientConnectionConfigToHclTerraform;
class AlloydbInstanceClientConnectionConfigOutputReference 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;
// ssl_config - computed: false, optional: true, required: false
this._sslConfig = new AlloydbInstanceClientConnectionConfigSslConfigOutputReference(this, "ssl_config");
}
get internalValue() {
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._requireConnectors !== undefined) {
hasAnyValues = true;
internalValueResult.requireConnectors = this._requireConnectors;
}
if (this._sslConfig?.internalValue !== undefined) {
hasAnyValues = true;
internalValueResult.sslConfig = this._sslConfig?.internalValue;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._requireConnectors = undefined;
this._sslConfig.internalValue = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._requireConnectors = value.requireConnectors;
this._sslConfig.internalValue = value.sslConfig;
}
}
get requireConnectors() {
return this.getBooleanAttribute('require_connectors');
}
set requireConnectors(value) {
this._requireConnectors = value;
}
resetRequireConnectors() {
this._requireConnectors = undefined;
}
// Temporarily expose input value. Use with caution.
get requireConnectorsInput() {
return this._requireConnectors;
}
get sslConfig() {
return this._sslConfig;
}
putSslConfig(value) {
this._sslConfig.internalValue = value;
}
resetSslConfig() {
this._sslConfig.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get sslConfigInput() {
return this._sslConfig.internalValue;
}
}
exports.AlloydbInstanceClientConnectionConfigOutputReference = AlloydbInstanceClientConnectionConfigOutputReference;
_b = JSII_RTTI_SYMBOL_1;
AlloydbInstanceClientConnectionConfigOutputReference[_b] = { fqn: "@cdktf/provider-google.alloydbInstance.AlloydbInstanceClientConnectionConfigOutputReference", version: "14.12.0" };
function alloydbInstanceMachineConfigToTerraform(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 {
cpu_count: cdktf.numberToTerraform(struct.cpuCount),
};
}
exports.alloydbInstanceMachineConfigToTerraform = alloydbInstanceMachineConfigToTerraform;
function alloydbInstanceMachineConfigToHclTerraform(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 = {
cpu_count: {
value: cdktf.numberToHclTerraform(struct.cpuCount),
isBlock: false,
type: "simple",
storageClassType: "number",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.alloydbInstanceMachineConfigToHclTerraform = alloydbInstanceMachineConfigToHclTerraform;
class AlloydbInstanceMachineConfigOutputReference 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._cpuCount !== undefined) {
hasAnyValues = true;
internalValueResult.cpuCount = this._cpuCount;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._cpuCount = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._cpuCount = value.cpuCount;
}
}
get cpuCount() {
return this.getNumberAttribute('cpu_count');
}
set cpuCount(value) {
this._cpuCount = value;
}
resetCpuCount() {
this._cpuCount = undefined;
}
// Temporarily expose input value. Use with caution.
get cpuCountInput() {
return this._cpuCount;
}
}
exports.AlloydbInstanceMachineConfigOutputReference = AlloydbInstanceMachineConfigOutputReference;
_c = JSII_RTTI_SYMBOL_1;
AlloydbInstanceMachineConfigOutputReference[_c] = { fqn: "@cdktf/provider-google.alloydbInstance.AlloydbInstanceMachineConfigOutputReference", version: "14.12.0" };
function alloydbInstanceNetworkConfigAuthorizedExternalNetworksToTerraform(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 {
cidr_range: cdktf.stringToTerraform(struct.cidrRange),
};
}
exports.alloydbInstanceNetworkConfigAuthorizedExternalNetworksToTerraform = alloydbInstanceNetworkConfigAuthorizedExternalNetworksToTerraform;
function alloydbInstanceNetworkConfigAuthorizedExternalNetworksToHclTerraform(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 = {
cidr_range: {
value: cdktf.stringToHclTerraform(struct.cidrRange),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.alloydbInstanceNetworkConfigAuthorizedExternalNetworksToHclTerraform = alloydbInstanceNetworkConfigAuthorizedExternalNetworksToHclTerraform;
class AlloydbInstanceNetworkConfigAuthorizedExternalNetworksOutputReference 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._cidrRange !== undefined) {
hasAnyValues = true;
internalValueResult.cidrRange = this._cidrRange;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this.resolvableValue = undefined;
this._cidrRange = 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._cidrRange = value.cidrRange;
}
}
get cidrRange() {
return this.getStringAttribute('cidr_range');
}
set cidrRange(value) {
this._cidrRange = value;
}
resetCidrRange() {
this._cidrRange = undefined;
}
// Temporarily expose input value. Use with caution.
get cidrRangeInput() {
return this._cidrRange;
}
}
exports.AlloydbInstanceNetworkConfigAuthorizedExternalNetworksOutputReference = AlloydbInstanceNetworkConfigAuthorizedExternalNetworksOutputReference;
_d = JSII_RTTI_SYMBOL_1;
AlloydbInstanceNetworkConfigAuthorizedExternalNetworksOutputReference[_d] = { fqn: "@cdktf/provider-google.alloydbInstance.AlloydbInstanceNetworkConfigAuthorizedExternalNetworksOutputReference", version: "14.12.0" };
class AlloydbInstanceNetworkConfigAuthorizedExternalNetworksList 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 AlloydbInstanceNetworkConfigAuthorizedExternalNetworksOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet);
}
}
exports.AlloydbInstanceNetworkConfigAuthorizedExternalNetworksList = AlloydbInstanceNetworkConfigAuthorizedExternalNetworksList;
_e = JSII_RTTI_SYMBOL_1;
AlloydbInstanceNetworkConfigAuthorizedExternalNetworksList[_e] = { fqn: "@cdktf/provider-google.alloydbInstance.AlloydbInstanceNetworkConfigAuthorizedExternalNetworksList", version: "14.12.0" };
function alloydbInstanceNetworkConfigToTerraform(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 {
enable_outbound_public_ip: cdktf.booleanToTerraform(struct.enableOutboundPublicIp),
enable_public_ip: cdktf.booleanToTerraform(struct.enablePublicIp),
authorized_external_networks: cdktf.listMapper(alloydbInstanceNetworkConfigAuthorizedExternalNetworksToTerraform, true)(struct.authorizedExternalNetworks),
};
}
exports.alloydbInstanceNetworkConfigToTerraform = alloydbInstanceNetworkConfigToTerraform;
function alloydbInstanceNetworkConfigToHclTerraform(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 = {
enable_outbound_public_ip: {
value: cdktf.booleanToHclTerraform(struct.enableOutboundPublicIp),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
enable_public_ip: {
value: cdktf.booleanToHclTerraform(struct.enablePublicIp),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
authorized_external_networks: {
value: cdktf.listMapperHcl(alloydbInstanceNetworkConfigAuthorizedExternalNetworksToHclTerraform, true)(struct.authorizedExternalNetworks),
isBlock: true,
type: "list",
storageClassType: "AlloydbInstanceNetworkConfigAuthorizedExternalNetworksList",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.alloydbInstanceNetworkConfigToHclTerraform = alloydbInstanceNetworkConfigToHclTerraform;
class AlloydbInstanceNetworkConfigOutputReference 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;
// authorized_external_networks - computed: false, optional: true, required: false
this._authorizedExternalNetworks = new AlloydbInstanceNetworkConfigAuthorizedExternalNetworksList(this, "authorized_external_networks", false);
}
get internalValue() {
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._enableOutboundPublicIp !== undefined) {
hasAnyValues = true;
internalValueResult.enableOutboundPublicIp = this._enableOutboundPublicIp;
}
if (this._enablePublicIp !== undefined) {
hasAnyValues = true;
internalValueResult.enablePublicIp = this._enablePublicIp;
}
if (this._authorizedExternalNetworks?.internalValue !== undefined) {
hasAnyValues = true;
internalValueResult.authorizedExternalNetworks = this._authorizedExternalNetworks?.internalValue;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._enableOutboundPublicIp = undefined;
this._enablePublicIp = undefined;
this._authorizedExternalNetworks.internalValue = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._enableOutboundPublicIp = value.enableOutboundPublicIp;
this._enablePublicIp = value.enablePublicIp;
this._authorizedExternalNetworks.internalValue = value.authorizedExternalNetworks;
}
}
get enableOutboundPublicIp() {
return this.getBooleanAttribute('enable_outbound_public_ip');
}
set enableOutboundPublicIp(value) {
this._enableOutboundPublicIp = value;
}
resetEnableOutboundPublicIp() {
this._enableOutboundPublicIp = undefined;
}
// Temporarily expose input value. Use with caution.
get enableOutboundPublicIpInput() {
return this._enableOutboundPublicIp;
}
get enablePublicIp() {
return this.getBooleanAttribute('enable_public_ip');
}
set enablePublicIp(value) {
this._enablePublicIp = value;
}
resetEnablePublicIp() {
this._enablePublicIp = undefined;
}
// Temporarily expose input value. Use with caution.
get enablePublicIpInput() {
return this._enablePublicIp;
}
get authorizedExternalNetworks() {
return this._authorizedExternalNetworks;
}
putAuthorizedExternalNetworks(value) {
this._authorizedExternalNetworks.internalValue = value;
}
resetAuthorizedExternalNetworks() {
this._authorizedExternalNetworks.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get authorizedExternalNetworksInput() {
return this._authorizedExternalNetworks.internalValue;
}
}
exports.AlloydbInstanceNetworkConfigOutputReference = AlloydbInstanceNetworkConfigOutputReference;
_f = JSII_RTTI_SYMBOL_1;
AlloydbInstanceNetworkConfigOutputReference[_f] = { fqn: "@cdktf/provider-google.alloydbInstance.AlloydbInstanceNetworkConfigOutputReference", version: "14.12.0" };
function alloydbInstancePscInstanceConfigToTerraform(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 {
allowed_consumer_projects: cdktf.listMapper(cdktf.stringToTerraform, false)(struct.allowedConsumerProjects),
};
}
exports.alloydbInstancePscInstanceConfigToTerraform = alloydbInstancePscInstanceConfigToTerraform;
function alloydbInstancePscInstanceConfigToHclTerraform(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 = {
allowed_consumer_projects: {
value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct.allowedConsumerProjects),
isBlock: false,
type: "list",
storageClassType: "stringList",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.alloydbInstancePscInstanceConfigToHclTerraform = alloydbInstancePscInstanceConfigToHclTerraform;
class AlloydbInstancePscInstanceConfigOutputReference 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._allowedConsumerProjects !== undefined) {
hasAnyValues = true;
internalValueResult.allowedConsumerProjects = this._allowedConsumerProjects;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._allowedConsumerProjects = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._allowedConsumerProjects = value.allowedConsumerProjects;
}
}
get allowedConsumerProjects() {
return this.getListAttribute('allowed_consumer_projects');
}
set allowedConsumerProjects(value) {
this._allowedConsumerProjects = value;
}
resetAllowedConsumerProjects() {
this._allowedConsumerProjects = undefined;
}
// Temporarily expose input value. Use with caution.
get allowedConsumerProjectsInput() {
return this._allowedConsumerProjects;
}
// psc_dns_name - computed: true, optional: false, required: false
get pscDnsName() {
return this.getStringAttribute('psc_dns_name');
}
// service_attachment_link - computed: true, optional: false, required: false
get serviceAttachmentLink() {
return this.getStringAttribute('service_attachment_link');
}
}
exports.AlloydbInstancePscInstanceConfigOutputReference = AlloydbInstancePscInstanceConfigOutputReference;
_g = JSII_RTTI_SYMBOL_1;
AlloydbInstancePscInstanceConfigOutputReference[_g] = { fqn: "@cdktf/provider-google.alloydbInstance.AlloydbInstancePscInstanceConfigOutputReference", version: "14.12.0" };
function alloydbInstanceQueryInsightsConfigToTerraform(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 {
query_plans_per_minute: cdktf.numberToTerraform(struct.queryPlansPerMinute),
query_string_length: cdktf.numberToTerraform(struct.queryStringLength),
record_application_tags: cdktf.booleanToTerraform(struct.recordApplicationTags),
record_client_address: cdktf.booleanToTerraform(struct.recordClientAddress),
};
}
exports.alloydbInstanceQueryInsightsConfigToTerraform = alloydbInstanceQueryInsightsConfigToTerraform;
function alloydbInstanceQueryInsightsConfigToHclTerraform(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 = {
query_plans_per_minute: {
value: cdktf.numberToHclTerraform(struct.queryPlansPerMinute),
isBlock: false,
type: "simple",
storageClassType: "number",
},
query_string_length: {
value: cdktf.numberToHclTerraform(struct.queryStringLength),
isBlock: false,
type: "simple",
storageClassType: "number",
},
record_application_tags: {
value: cdktf.booleanToHclTerraform(struct.recordApplicationTags),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
record_client_address: {
value: cdktf.booleanToHclTerraform(struct.recordClientAddress),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.alloydbInstanceQueryInsightsConfigToHclTerraform = alloydbInstanceQueryInsightsConfigToHclTerraform;
class AlloydbInstanceQueryInsightsConfigOutputReference 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._queryPlansPerMinute !== undefined) {
hasAnyValues = true;
internalValueResult.queryPlansPerMinute = this._queryPlansPerMinute;
}
if (this._queryStringLength !== undefined) {
hasAnyValues = true;
internalValueResult.queryStringLength = this._queryStringLength;
}
if (this._recordApplicationTags !== undefined) {
hasAnyValues = true;
internalValueResult.recordApplicationTags = this._recordApplicationTags;
}
if (this._recordClientAddress !== undefined) {
hasAnyValues = true;
internalValueResult.recordClientAddress = this._recordClientAddress;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._queryPlansPerMinute = undefined;
this._queryStringLength = undefined;
this._recordApplicationTags = undefined;
this._recordClientAddress = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._queryPlansPerMinute = value.queryPlansPerMinute;
this._queryStringLength = value.queryStringLength;
this._recordApplicationTags = value.recordApplicationTags;
this._recordClientAddress = value.recordClientAddress;
}
}
get queryPlansPerMinute() {
return this.getNumberAttribute('query_plans_per_minute');
}
set queryPlansPerMinute(value) {
this._queryPlansPerMinute = value;
}
resetQueryPlansPerMinute() {
this._queryPlansPerMinute = undefined;
}
// Temporarily expose input value. Use with caution.
get queryPlansPerMinuteInput() {
return this._queryPlansPerMinute;
}
get queryStringLength() {
return this.getNumberAttribute('query_string_length');
}
set queryStringLength(value) {
this._queryStringLength = value;
}
resetQueryStringLength() {
this._queryStringLength = undefined;
}
// Temporarily expose input value. Use with caution.
get queryStringLengthInput() {
return this._queryStringLength;
}
get recordApplicationTags() {
return this.getBooleanAttribute('record_application_tags');
}
set recordApplicationTags(value) {
this._recordApplicationTags = value;
}
resetRecordApplicationTags() {
this._recordApplicationTags = undefined;
}
// Temporarily expose input value. Use with caution.
get recordApplicationTagsInput() {
return this._recordApplicationTags;
}
get recordClientAddress() {
return this.getBooleanAttribute('record_client_address');
}
set recordClientAddress(value) {
this._recordClientAddress = value;
}
resetRecordClientAddress() {
this._recordClientAddress = undefined;
}
// Temporarily expose input value. Use with caution.
get recordClientAddressInput() {
return this._recordClientAddress;
}
}
exports.AlloydbInstanceQueryInsightsConfigOutputReference = AlloydbInstanceQueryInsightsConfigOutputReference;
_h = JSII_RTTI_SYMBOL_1;
AlloydbInstanceQueryInsightsConfigOutputReference[_h] = { fqn: "@cdktf/provider-google.alloydbInstance.AlloydbInstanceQueryInsightsConfigOutputReference", version: "14.12.0" };
function alloydbInstanceReadPoolConfigToTerraform(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 {
node_count: cdktf.numberToTerraform(struct.nodeCount),
};
}
exports.alloydbInstanceReadPoolConfigToTerraform = alloydbInstanceReadPoolConfigToTerraform;
function alloydbInstanceReadPoolConfigToHclTerraform(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 = {
node_count: {
value: cdktf.numberToHclTerraform(struct.nodeCount),
isBlock: false,
type: "simple",
storageClassType: "number",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.alloydbInstanceReadPoolConfigToHclTerraform = alloydbInstanceReadPoolConfigToHclTerraform;
class AlloydbInstanceReadPoolConfigOutputReference 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._nodeCount !== undefined) {
hasAnyValues = true;
internalValueResult.nodeCount = this._nodeCount;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._nodeCount = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._nodeCount = value.nodeCount;
}
}
get nodeCount() {
return this.getNumberAttribute('node_count');
}
set nodeCount(value) {
this._nodeCount = value;
}
resetNodeCount() {
this._nodeCount = undefined;
}
// Temporarily expose input value. Use with caution.
get nodeCountInput() {
return this._nodeCount;
}
}
exports.AlloydbInstanceReadPoolConfigOutputReference = AlloydbInstanceReadPoolConfigOutputReference;
_j = JSII_RTTI_SYMBOL_1;
AlloydbInstanceReadPoolConfigOutputReference[_j] = { fqn: "@cdktf/provider-google.alloydbInstance.AlloydbInstanceReadPoolConfigOutputReference", version: "14.12.0" };
function alloydbInstanceTimeoutsToTerraform(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 {
create: cdktf.stringToTerraform(struct.create),
delete: cdktf.stringToTerraform(struct.delete),
update: cdktf.stringToTerraform(struct.update),
};
}
exports.alloydbInstanceTimeoutsToTerraform = alloydbInstanceTimeoutsToTerraform;
function alloydbInstanceTimeoutsToHclTerraform(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 = {
create: {
value: cdktf.stringToHclTerraform(struct.create),
isBlock: false,
type: "simple",
storageClassType: "string",
},
delete: {
value: cdktf.stringToHclTerraform(struct.delete),
isBlock: false,
type: "simple",
storageClassType: "string",
},
update: {
value: cdktf.stringToHclTerraform(struct.update),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.alloydbInstanceTimeoutsToHclTerraform = alloydbInstanceTimeoutsToHclTerraform;
class AlloydbInstanceTimeoutsOutputReference 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);
this.isEmptyObject = false;
}
get internalValue() {
if (this.resolvableValue) {
return this.resolvableValue;
}
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._create !== undefined) {
hasAnyValues = true;
internalValueResult.create = this._create;
}
if (this._delete !== undefined) {
hasAnyValues = true;
internalValueResult.delete = this._delete;
}
if (this._update !== undefined) {
hasAnyValues = true;
internalValueResult.update = this._update;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this.resolvableValue = undefined;
this._create = undefined;
this._delete = undefined;
this._update = 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._create = value.create;
this._delete = value.delete;
this._update = value.update;
}
}
get create() {
return this.getStringAttribute('create');
}
set create(value) {
this._create = value;
}
resetCreate() {
this._create = undefined;
}
// Temporarily expose input value. Use with caution.
get createInput() {
return this._create;
}
get delete() {
return this.getStringAttribute('delete');
}
set delete(value) {
this._delete = value;
}
resetDelete() {
this._delete = undefined;
}
// Temporarily expose input value. Use with caution.
get deleteInput() {
return this._delete;
}
get update() {
return this.getStringAttribute('update');
}
set update(value) {
this._update = value;
}
resetUpdate() {
this._update = undefined;
}
// Temporarily expose input value. Use with caution.
get updateInput() {
return this._update;
}
}
exports.AlloydbInstanceTimeoutsOutputReference = AlloydbInstanceTimeoutsOutputReference;
_k = JSII_RTTI_SYMBOL_1;
AlloydbInstanceTimeoutsOutputReference[_k] = { fqn: "@cdktf/provider-google.alloydbInstance.AlloydbInstanceTimeoutsOutputReference", version: "14.12.0" };
/**
* Represents a {@link https://registry.terraform.io/providers/hashicorp/google/6.13.0/docs/resources/alloydb_instance google_alloydb_instance}
*/
class AlloydbInstance extends cdktf.TerraformResource {
// ==============
// STATIC Methods
// ==============
/**
* Generates CDKTF code for importing a AlloydbInstance 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 AlloydbInstance to import
* @param importFromId The id of the existing AlloydbInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/hashicorp/google/6.13.0/docs/resources/alloydb_instance#import import section} in the documentation of this resource for the id to use
* @param provider? Optional instance of the provider where the AlloydbInstance to import is found
*/
static generateConfigForImport(scope, importToId, importFromId, provider) {
return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "google_alloydb_instance", importId: importFromId, provider });
}
// ===========
// INITIALIZER
// ===========
/**
* Create a new {@link https://registry.terraform.io/providers/hashicorp/google/6.13.0/docs/resources/alloydb_instance google_alloydb_instance} 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 AlloydbInstanceConfig
*/
constructor(scope, id, config) {
super(scope, id, {
terraformResourceType: 'google_alloydb_instance',
terraformGeneratorMetadata: {
providerName: 'google',
providerVersion: '6.13.0',
providerVersionConstraint: '~> 6.0'
},
provider: config.provider,
dependsOn: config.dependsOn,
count: config.count,
lifecycle: config.lifecycle,
provisioners: config.provisioners,
connection: config.connection,
forEach: config.forEach
});
// effective_annotations - computed: true, optional: false, required: false
this._effectiveAnnotations = new cdktf.StringMap(this, "effective_annotations");
// effective_labels - computed: true, optional: false, required: false
this._effectiveLabels = new cdktf.StringMap(this, "effective_labels");
// terraform_labels - computed: true, optional: false, required: false
this._terraformLabels = new cdktf.StringMap(this, "terraform_labels");
// client_connection_config - computed: false, optional: true, required: false
this._clientConnectionConfig = new AlloydbInstanceClientConnectionConfigOutputReference(this, "client_connection_config");
// machine_config - computed: false, optional: true, required: false
this._machineConfig = new AlloydbInstanceMachineConfigOutputReference(this, "machine_config");
// network_config - computed: false, optional: true, required: false
this._networkConfig = new AlloydbInstanceNetworkConfigOutputReference(this, "network_config");
// psc_instance_config - computed: false, optional: true, required: false
this._pscInstanceConfig = new AlloydbInstancePscInstanceConfigOutputReference(this, "psc_instance_config");
// query_insights_config - computed: false, optional: true, required: false
this._queryInsightsConfig = new AlloydbInstanceQueryInsightsConfigOutputReference(this, "query_insights_config");
// read_pool_config - computed: false, optional: true, required: false
this._readPoolConfig = new AlloydbInstanceReadPoolConfigOutputReference(this, "read_pool_config");
// timeouts - computed: false, optional: true, required: false
this._timeouts = new AlloydbInstanceTimeoutsOutputReference(this, "timeouts");
this._annotations = config.annotations;
this._availabilityType = config.availabilityType;
this._cluster = config.cluster;
this._databaseFlags = config.databaseFlags;
this._displayName = config.displayName;
this._gceZone = config.gceZone;
this._id = config.id;
this._instanceId = config.instanceId;
this._instanceType = config.instanceType;
this._labels = config.labels;
this._clientConnectionConfig.internalValue = config.clientConnectionConfig;
this._machineConfig.internalValue = config.machineConfig;
this._networkConfig.internalValue = config.networkConfig;
this._pscInstanceConfig.internalValue = config.pscInstanceConfig;
this._queryInsightsConfig.internalValue = config.queryInsightsConfig;
this._readPoolConfig.internalValue = config.readPoolConfig;
this._timeouts.internalValue = config.timeouts;
}
get annotations() {
return this.getStringMapAttribute('annotations');
}
set annotations(value) {
this._annotations = value;
}
resetAnnotations() {
this._annotations = undefined;
}
// Temporarily expose input value. Use with caution.
get annotationsInput() {
return this._annotations;
}
get availabilityType() {
return this.getStringAttribute('availability_type');
}
set availabilityType(value) {
this._availabilityType = value;
}
resetAvailabilityType() {
this._availabilityType = undefined;
}
// Temporarily expose input value. Use with caution.
get availabilityTypeInput() {
return this._availabilityType;
}
get cluster() {
return this.getStringAttribute('cluster');
}
set cluster(value) {
this._cluster = value;
}
// Temporarily expose input value. Use with caution.
get clusterInput() {
return this._cluster;
}
// create_time - computed: true, optional: false, required: false
get createTime() {
return this.getStringAttribute('create_time');
}
get databaseFlags() {
return this.getStringMapAttribute('database_flags');
}
set databaseFlags(value) {
this._databaseFlags = value;
}
resetDatabaseFlags() {
this._databaseFlags = undefined;
}
// Temporarily expose input value. Use with caution.
get databaseFlagsInput() {
return this._databaseFlags;
}
get displayName() {
return this.getStringAttribute('display_name');
}
set displayName(value) {
this._displayName = value;
}
resetDisplayName() {
this._displayName = undefined;
}
// Temporarily expose input value. Use with caution.
get displayNameInput() {
return this._displayName;
}
get effectiveAnnotations() {
return this._effectiveAnnotations;
}
get effectiveLabels() {
return this._effectiveLabels;
}
get gceZone() {
return this.getStringAttribute('gce_zone');
}
set gceZone(value) {
this._gceZone = value;
}
resetGceZone() {
this._gceZone = undefined;
}
// Temporarily expose input value. Use with caution.
get gceZoneInput() {
return this._gceZone;
}
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 instanceId() {
return this.getStringAttribute('instance_id');
}
set instanceId(value) {
this._instanceId = value;
}
// Temporarily expose input value. Use with caution.
get instanceIdInput() {
return this._instanceId;
}
get instanceType() {
return this.getStringAttribute('instance_type');
}
set instanceType(value) {
this._instanceType = value;
}
// Temporarily expose input value. Use with caution.
get instanceTypeInput() {
return this._instanceType;
}
// ip_address - computed: true, optional: false, required: false
get ipAddress() {
return this.getStringAttribute('ip_address');
}
get labels() {
return this.getStringMapAttribute('l