UNPKG

@cdktf/provider-google

Version:

Prebuilt google Provider for Terraform CDK (cdktf)

1,084 lines (1,083 loc) 190 kB
"use strict"; var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; Object.defineProperty(exports, "__esModule", { value: true }); exports.SpannerInstance = exports.SpannerInstanceTimeoutsOutputReference = exports.spannerInstanceTimeoutsToHclTerraform = exports.spannerInstanceTimeoutsToTerraform = exports.SpannerInstanceAutoscalingConfigOutputReference = exports.spannerInstanceAutoscalingConfigToHclTerraform = exports.spannerInstanceAutoscalingConfigToTerraform = exports.SpannerInstanceAutoscalingConfigAutoscalingTargetsOutputReference = exports.spannerInstanceAutoscalingConfigAutoscalingTargetsToHclTerraform = exports.spannerInstanceAutoscalingConfigAutoscalingTargetsToTerraform = exports.SpannerInstanceAutoscalingConfigAutoscalingLimitsOutputReference = exports.spannerInstanceAutoscalingConfigAutoscalingLimitsToHclTerraform = exports.spannerInstanceAutoscalingConfigAutoscalingLimitsToTerraform = exports.SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsList = exports.SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOutputReference = exports.spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsToHclTerraform = exports.spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsToTerraform = exports.SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsReplicaSelectionOutputReference = exports.spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsReplicaSelectionToHclTerraform = exports.spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsReplicaSelectionToTerraform = exports.SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesOutputReference = exports.spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesToHclTerraform = exports.spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesToTerraform = exports.SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesAutoscalingLimitsOutputReference = exports.spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesAutoscalingLimitsToHclTerraform = exports.spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesAutoscalingLimitsToTerraform = void 0; const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti"); const cdktf = require("cdktf"); function spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesAutoscalingLimitsToTerraform(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 { max_nodes: cdktf.numberToTerraform(struct.maxNodes), min_nodes: cdktf.numberToTerraform(struct.minNodes), }; } exports.spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesAutoscalingLimitsToTerraform = spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesAutoscalingLimitsToTerraform; function spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesAutoscalingLimitsToHclTerraform(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 = { max_nodes: { value: cdktf.numberToHclTerraform(struct.maxNodes), isBlock: false, type: "simple", storageClassType: "number", }, min_nodes: { value: cdktf.numberToHclTerraform(struct.minNodes), isBlock: false, type: "simple", storageClassType: "number", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } exports.spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesAutoscalingLimitsToHclTerraform = spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesAutoscalingLimitsToHclTerraform; class SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesAutoscalingLimitsOutputReference 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._maxNodes !== undefined) { hasAnyValues = true; internalValueResult.maxNodes = this._maxNodes; } if (this._minNodes !== undefined) { hasAnyValues = true; internalValueResult.minNodes = this._minNodes; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._maxNodes = undefined; this._minNodes = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._maxNodes = value.maxNodes; this._minNodes = value.minNodes; } } get maxNodes() { return this.getNumberAttribute('max_nodes'); } set maxNodes(value) { this._maxNodes = value; } // Temporarily expose input value. Use with caution. get maxNodesInput() { return this._maxNodes; } get minNodes() { return this.getNumberAttribute('min_nodes'); } set minNodes(value) { this._minNodes = value; } // Temporarily expose input value. Use with caution. get minNodesInput() { return this._minNodes; } } exports.SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesAutoscalingLimitsOutputReference = SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesAutoscalingLimitsOutputReference; _a = JSII_RTTI_SYMBOL_1; SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesAutoscalingLimitsOutputReference[_a] = { fqn: "@cdktf/provider-google.spannerInstance.SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesAutoscalingLimitsOutputReference", version: "14.12.0" }; function spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesToTerraform(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 { autoscaling_limits: spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesAutoscalingLimitsToTerraform(struct.autoscalingLimits), }; } exports.spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesToTerraform = spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesToTerraform; function spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesToHclTerraform(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 = { autoscaling_limits: { value: spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesAutoscalingLimitsToHclTerraform(struct.autoscalingLimits), isBlock: true, type: "list", storageClassType: "SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesAutoscalingLimitsList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } exports.spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesToHclTerraform = spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesToHclTerraform; class SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesOutputReference 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; // autoscaling_limits - computed: false, optional: false, required: true this._autoscalingLimits = new SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesAutoscalingLimitsOutputReference(this, "autoscaling_limits"); } get internalValue() { let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._autoscalingLimits?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.autoscalingLimits = this._autoscalingLimits?.internalValue; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._autoscalingLimits.internalValue = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._autoscalingLimits.internalValue = value.autoscalingLimits; } } get autoscalingLimits() { return this._autoscalingLimits; } putAutoscalingLimits(value) { this._autoscalingLimits.internalValue = value; } // Temporarily expose input value. Use with caution. get autoscalingLimitsInput() { return this._autoscalingLimits.internalValue; } } exports.SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesOutputReference = SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesOutputReference; _b = JSII_RTTI_SYMBOL_1; SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesOutputReference[_b] = { fqn: "@cdktf/provider-google.spannerInstance.SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesOutputReference", version: "14.12.0" }; function spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsReplicaSelectionToTerraform(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 { location: cdktf.stringToTerraform(struct.location), }; } exports.spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsReplicaSelectionToTerraform = spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsReplicaSelectionToTerraform; function spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsReplicaSelectionToHclTerraform(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 = { location: { value: cdktf.stringToHclTerraform(struct.location), isBlock: false, type: "simple", storageClassType: "string", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } exports.spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsReplicaSelectionToHclTerraform = spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsReplicaSelectionToHclTerraform; class SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsReplicaSelectionOutputReference 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._location !== undefined) { hasAnyValues = true; internalValueResult.location = this._location; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._location = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._location = value.location; } } get location() { return this.getStringAttribute('location'); } set location(value) { this._location = value; } // Temporarily expose input value. Use with caution. get locationInput() { return this._location; } } exports.SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsReplicaSelectionOutputReference = SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsReplicaSelectionOutputReference; _c = JSII_RTTI_SYMBOL_1; SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsReplicaSelectionOutputReference[_c] = { fqn: "@cdktf/provider-google.spannerInstance.SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsReplicaSelectionOutputReference", version: "14.12.0" }; function spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsToTerraform(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 { overrides: spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesToTerraform(struct.overrides), replica_selection: spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsReplicaSelectionToTerraform(struct.replicaSelection), }; } exports.spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsToTerraform = spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsToTerraform; function spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsToHclTerraform(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 = { overrides: { value: spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesToHclTerraform(struct.overrides), isBlock: true, type: "list", storageClassType: "SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesList", }, replica_selection: { value: spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsReplicaSelectionToHclTerraform(struct.replicaSelection), isBlock: true, type: "list", storageClassType: "SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsReplicaSelectionList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } exports.spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsToHclTerraform = spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsToHclTerraform; class SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOutputReference 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; // overrides - computed: false, optional: false, required: true this._overrides = new SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOverridesOutputReference(this, "overrides"); // replica_selection - computed: false, optional: false, required: true this._replicaSelection = new SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsReplicaSelectionOutputReference(this, "replica_selection"); } get internalValue() { if (this.resolvableValue) { return this.resolvableValue; } let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._overrides?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.overrides = this._overrides?.internalValue; } if (this._replicaSelection?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.replicaSelection = this._replicaSelection?.internalValue; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this.resolvableValue = undefined; this._overrides.internalValue = undefined; this._replicaSelection.internalValue = 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._overrides.internalValue = value.overrides; this._replicaSelection.internalValue = value.replicaSelection; } } get overrides() { return this._overrides; } putOverrides(value) { this._overrides.internalValue = value; } // Temporarily expose input value. Use with caution. get overridesInput() { return this._overrides.internalValue; } get replicaSelection() { return this._replicaSelection; } putReplicaSelection(value) { this._replicaSelection.internalValue = value; } // Temporarily expose input value. Use with caution. get replicaSelectionInput() { return this._replicaSelection.internalValue; } } exports.SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOutputReference = SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOutputReference; _d = JSII_RTTI_SYMBOL_1; SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOutputReference[_d] = { fqn: "@cdktf/provider-google.spannerInstance.SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOutputReference", version: "14.12.0" }; class SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsList 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 SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); } } exports.SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsList = SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsList; _e = JSII_RTTI_SYMBOL_1; SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsList[_e] = { fqn: "@cdktf/provider-google.spannerInstance.SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsList", version: "14.12.0" }; function spannerInstanceAutoscalingConfigAutoscalingLimitsToTerraform(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 { max_nodes: cdktf.numberToTerraform(struct.maxNodes), max_processing_units: cdktf.numberToTerraform(struct.maxProcessingUnits), min_nodes: cdktf.numberToTerraform(struct.minNodes), min_processing_units: cdktf.numberToTerraform(struct.minProcessingUnits), }; } exports.spannerInstanceAutoscalingConfigAutoscalingLimitsToTerraform = spannerInstanceAutoscalingConfigAutoscalingLimitsToTerraform; function spannerInstanceAutoscalingConfigAutoscalingLimitsToHclTerraform(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 = { max_nodes: { value: cdktf.numberToHclTerraform(struct.maxNodes), isBlock: false, type: "simple", storageClassType: "number", }, max_processing_units: { value: cdktf.numberToHclTerraform(struct.maxProcessingUnits), isBlock: false, type: "simple", storageClassType: "number", }, min_nodes: { value: cdktf.numberToHclTerraform(struct.minNodes), isBlock: false, type: "simple", storageClassType: "number", }, min_processing_units: { value: cdktf.numberToHclTerraform(struct.minProcessingUnits), isBlock: false, type: "simple", storageClassType: "number", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } exports.spannerInstanceAutoscalingConfigAutoscalingLimitsToHclTerraform = spannerInstanceAutoscalingConfigAutoscalingLimitsToHclTerraform; class SpannerInstanceAutoscalingConfigAutoscalingLimitsOutputReference 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._maxNodes !== undefined) { hasAnyValues = true; internalValueResult.maxNodes = this._maxNodes; } if (this._maxProcessingUnits !== undefined) { hasAnyValues = true; internalValueResult.maxProcessingUnits = this._maxProcessingUnits; } if (this._minNodes !== undefined) { hasAnyValues = true; internalValueResult.minNodes = this._minNodes; } if (this._minProcessingUnits !== undefined) { hasAnyValues = true; internalValueResult.minProcessingUnits = this._minProcessingUnits; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._maxNodes = undefined; this._maxProcessingUnits = undefined; this._minNodes = undefined; this._minProcessingUnits = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._maxNodes = value.maxNodes; this._maxProcessingUnits = value.maxProcessingUnits; this._minNodes = value.minNodes; this._minProcessingUnits = value.minProcessingUnits; } } get maxNodes() { return this.getNumberAttribute('max_nodes'); } set maxNodes(value) { this._maxNodes = value; } resetMaxNodes() { this._maxNodes = undefined; } // Temporarily expose input value. Use with caution. get maxNodesInput() { return this._maxNodes; } get maxProcessingUnits() { return this.getNumberAttribute('max_processing_units'); } set maxProcessingUnits(value) { this._maxProcessingUnits = value; } resetMaxProcessingUnits() { this._maxProcessingUnits = undefined; } // Temporarily expose input value. Use with caution. get maxProcessingUnitsInput() { return this._maxProcessingUnits; } get minNodes() { return this.getNumberAttribute('min_nodes'); } set minNodes(value) { this._minNodes = value; } resetMinNodes() { this._minNodes = undefined; } // Temporarily expose input value. Use with caution. get minNodesInput() { return this._minNodes; } get minProcessingUnits() { return this.getNumberAttribute('min_processing_units'); } set minProcessingUnits(value) { this._minProcessingUnits = value; } resetMinProcessingUnits() { this._minProcessingUnits = undefined; } // Temporarily expose input value. Use with caution. get minProcessingUnitsInput() { return this._minProcessingUnits; } } exports.SpannerInstanceAutoscalingConfigAutoscalingLimitsOutputReference = SpannerInstanceAutoscalingConfigAutoscalingLimitsOutputReference; _f = JSII_RTTI_SYMBOL_1; SpannerInstanceAutoscalingConfigAutoscalingLimitsOutputReference[_f] = { fqn: "@cdktf/provider-google.spannerInstance.SpannerInstanceAutoscalingConfigAutoscalingLimitsOutputReference", version: "14.12.0" }; function spannerInstanceAutoscalingConfigAutoscalingTargetsToTerraform(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 { high_priority_cpu_utilization_percent: cdktf.numberToTerraform(struct.highPriorityCpuUtilizationPercent), storage_utilization_percent: cdktf.numberToTerraform(struct.storageUtilizationPercent), }; } exports.spannerInstanceAutoscalingConfigAutoscalingTargetsToTerraform = spannerInstanceAutoscalingConfigAutoscalingTargetsToTerraform; function spannerInstanceAutoscalingConfigAutoscalingTargetsToHclTerraform(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 = { high_priority_cpu_utilization_percent: { value: cdktf.numberToHclTerraform(struct.highPriorityCpuUtilizationPercent), isBlock: false, type: "simple", storageClassType: "number", }, storage_utilization_percent: { value: cdktf.numberToHclTerraform(struct.storageUtilizationPercent), isBlock: false, type: "simple", storageClassType: "number", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } exports.spannerInstanceAutoscalingConfigAutoscalingTargetsToHclTerraform = spannerInstanceAutoscalingConfigAutoscalingTargetsToHclTerraform; class SpannerInstanceAutoscalingConfigAutoscalingTargetsOutputReference 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._highPriorityCpuUtilizationPercent !== undefined) { hasAnyValues = true; internalValueResult.highPriorityCpuUtilizationPercent = this._highPriorityCpuUtilizationPercent; } if (this._storageUtilizationPercent !== undefined) { hasAnyValues = true; internalValueResult.storageUtilizationPercent = this._storageUtilizationPercent; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._highPriorityCpuUtilizationPercent = undefined; this._storageUtilizationPercent = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._highPriorityCpuUtilizationPercent = value.highPriorityCpuUtilizationPercent; this._storageUtilizationPercent = value.storageUtilizationPercent; } } get highPriorityCpuUtilizationPercent() { return this.getNumberAttribute('high_priority_cpu_utilization_percent'); } set highPriorityCpuUtilizationPercent(value) { this._highPriorityCpuUtilizationPercent = value; } resetHighPriorityCpuUtilizationPercent() { this._highPriorityCpuUtilizationPercent = undefined; } // Temporarily expose input value. Use with caution. get highPriorityCpuUtilizationPercentInput() { return this._highPriorityCpuUtilizationPercent; } get storageUtilizationPercent() { return this.getNumberAttribute('storage_utilization_percent'); } set storageUtilizationPercent(value) { this._storageUtilizationPercent = value; } resetStorageUtilizationPercent() { this._storageUtilizationPercent = undefined; } // Temporarily expose input value. Use with caution. get storageUtilizationPercentInput() { return this._storageUtilizationPercent; } } exports.SpannerInstanceAutoscalingConfigAutoscalingTargetsOutputReference = SpannerInstanceAutoscalingConfigAutoscalingTargetsOutputReference; _g = JSII_RTTI_SYMBOL_1; SpannerInstanceAutoscalingConfigAutoscalingTargetsOutputReference[_g] = { fqn: "@cdktf/provider-google.spannerInstance.SpannerInstanceAutoscalingConfigAutoscalingTargetsOutputReference", version: "14.12.0" }; function spannerInstanceAutoscalingConfigToTerraform(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 { asymmetric_autoscaling_options: cdktf.listMapper(spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsToTerraform, true)(struct.asymmetricAutoscalingOptions), autoscaling_limits: spannerInstanceAutoscalingConfigAutoscalingLimitsToTerraform(struct.autoscalingLimits), autoscaling_targets: spannerInstanceAutoscalingConfigAutoscalingTargetsToTerraform(struct.autoscalingTargets), }; } exports.spannerInstanceAutoscalingConfigToTerraform = spannerInstanceAutoscalingConfigToTerraform; function spannerInstanceAutoscalingConfigToHclTerraform(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 = { asymmetric_autoscaling_options: { value: cdktf.listMapperHcl(spannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsToHclTerraform, true)(struct.asymmetricAutoscalingOptions), isBlock: true, type: "list", storageClassType: "SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsList", }, autoscaling_limits: { value: spannerInstanceAutoscalingConfigAutoscalingLimitsToHclTerraform(struct.autoscalingLimits), isBlock: true, type: "list", storageClassType: "SpannerInstanceAutoscalingConfigAutoscalingLimitsList", }, autoscaling_targets: { value: spannerInstanceAutoscalingConfigAutoscalingTargetsToHclTerraform(struct.autoscalingTargets), isBlock: true, type: "list", storageClassType: "SpannerInstanceAutoscalingConfigAutoscalingTargetsList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } exports.spannerInstanceAutoscalingConfigToHclTerraform = spannerInstanceAutoscalingConfigToHclTerraform; class SpannerInstanceAutoscalingConfigOutputReference 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; // asymmetric_autoscaling_options - computed: false, optional: true, required: false this._asymmetricAutoscalingOptions = new SpannerInstanceAutoscalingConfigAsymmetricAutoscalingOptionsList(this, "asymmetric_autoscaling_options", false); // autoscaling_limits - computed: false, optional: true, required: false this._autoscalingLimits = new SpannerInstanceAutoscalingConfigAutoscalingLimitsOutputReference(this, "autoscaling_limits"); // autoscaling_targets - computed: false, optional: true, required: false this._autoscalingTargets = new SpannerInstanceAutoscalingConfigAutoscalingTargetsOutputReference(this, "autoscaling_targets"); } get internalValue() { let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._asymmetricAutoscalingOptions?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.asymmetricAutoscalingOptions = this._asymmetricAutoscalingOptions?.internalValue; } if (this._autoscalingLimits?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.autoscalingLimits = this._autoscalingLimits?.internalValue; } if (this._autoscalingTargets?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.autoscalingTargets = this._autoscalingTargets?.internalValue; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._asymmetricAutoscalingOptions.internalValue = undefined; this._autoscalingLimits.internalValue = undefined; this._autoscalingTargets.internalValue = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._asymmetricAutoscalingOptions.internalValue = value.asymmetricAutoscalingOptions; this._autoscalingLimits.internalValue = value.autoscalingLimits; this._autoscalingTargets.internalValue = value.autoscalingTargets; } } get asymmetricAutoscalingOptions() { return this._asymmetricAutoscalingOptions; } putAsymmetricAutoscalingOptions(value) { this._asymmetricAutoscalingOptions.internalValue = value; } resetAsymmetricAutoscalingOptions() { this._asymmetricAutoscalingOptions.internalValue = undefined; } // Temporarily expose input value. Use with caution. get asymmetricAutoscalingOptionsInput() { return this._asymmetricAutoscalingOptions.internalValue; } get autoscalingLimits() { return this._autoscalingLimits; } putAutoscalingLimits(value) { this._autoscalingLimits.internalValue = value; } resetAutoscalingLimits() { this._autoscalingLimits.internalValue = undefined; } // Temporarily expose input value. Use with caution. get autoscalingLimitsInput() { return this._autoscalingLimits.internalValue; } get autoscalingTargets() { return this._autoscalingTargets; } putAutoscalingTargets(value) { this._autoscalingTargets.internalValue = value; } resetAutoscalingTargets() { this._autoscalingTargets.internalValue = undefined; } // Temporarily expose input value. Use with caution. get autoscalingTargetsInput() { return this._autoscalingTargets.internalValue; } } exports.SpannerInstanceAutoscalingConfigOutputReference = SpannerInstanceAutoscalingConfigOutputReference; _h = JSII_RTTI_SYMBOL_1; SpannerInstanceAutoscalingConfigOutputReference[_h] = { fqn: "@cdktf/provider-google.spannerInstance.SpannerInstanceAutoscalingConfigOutputReference", version: "14.12.0" }; function spannerInstanceTimeoutsToTerraform(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.spannerInstanceTimeoutsToTerraform = spannerInstanceTimeoutsToTerraform; function spannerInstanceTimeoutsToHclTerraform(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.spannerInstanceTimeoutsToHclTerraform = spannerInstanceTimeoutsToHclTerraform; class SpannerInstanceTimeoutsOutputReference 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.SpannerInstanceTimeoutsOutputReference = SpannerInstanceTimeoutsOutputReference; _j = JSII_RTTI_SYMBOL_1; SpannerInstanceTimeoutsOutputReference[_j] = { fqn: "@cdktf/provider-google.spannerInstance.SpannerInstanceTimeoutsOutputReference", version: "14.12.0" }; /** * Represents a {@link https://registry.terraform.io/providers/hashicorp/google/6.13.0/docs/resources/spanner_instance google_spanner_instance} */ class SpannerInstance extends cdktf.TerraformResource { // ============== // STATIC Methods // ============== /** * Generates CDKTF code for importing a SpannerInstance 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 SpannerInstance to import * @param importFromId The id of the existing SpannerInstance that should be imported. Refer to the {@link https://registry.terraform.io/providers/hashicorp/google/6.13.0/docs/resources/spanner_instance#import import section} in the documentation of this resource for the id to use * @param provider? Optional instance of the provider where the SpannerInstance to import is found */ static generateConfigForImport(scope, importToId, importFromId, provider) { return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "google_spanner_instance", importId: importFromId, provider }); } // =========== // INITIALIZER // =========== /** * Create a new {@link https://registry.terraform.io/providers/hashicorp/google/6.13.0/docs/resources/spanner_instance google_spanner_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 SpannerInstanceConfig */ constructor(scope, id, config) { super(scope, id, { terraformResourceType: 'google_spanner_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_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"); // autoscaling_config - computed: false, optional: true, required: false this._autoscalingConfig = new SpannerInstanceAutoscalingConfigOutputReference(this, "autoscaling_config"); // timeouts - computed: false, optional: true, required: false this._timeouts = new SpannerInstanceTimeoutsOutputReference(this, "timeouts"); this._config = config.config; this._defaultBackupScheduleType = config.defaultBackupScheduleType; this._displayName = config.displayName; this._edition = config.edition; this._forceDestroy = config.forceDestroy; this._id = config.id; this._labels = config.labels; this._name = config.name; this._numNodes = config.numNodes; this._processingUnits = config.processingUnits; this._project = config.project; this._autoscalingConfig.internalValue = config.autoscalingConfig; this._timeouts.internalValue = config.timeouts; } get config() { return this.getStringAttribute('config'); } set config(value) { this._config = value; } // Temporarily expose input value. Use with caution. get configInput() { return this._config; } get defaultBackupScheduleType() { return this.getStringAttribute('default_backup_schedule_type'); } set defaultBackupScheduleType(value) { this._defaultBackupScheduleType = value; } resetDefaultBackupScheduleType() { this._defaultBackupScheduleType = undefined; } // Temporarily expose input value. Use with caution. get defaultBackupScheduleTypeInput() { return this._defaultBackupScheduleType; } get displayName() { return this.getStringAttribute('display_name'); } set displayName(value) { this._displayName = value; } // Temporarily expose input value. Use with caution. get displayNameInput() { return this._displayName; } get edition() { return this.getStringAttribute('edition'); } set edition(value) { this._edition = value; } resetEdition() { this._edition = undefined; } // Temporarily expose input value. Use with caution. get editionInput() { return this._edition; } get effectiveLabels() { return this._effectiveLabels; } get forceDestroy() { return this.getBooleanAttribute('force_destroy'); } set forceDestroy(value) { this._forceDestroy = value; } resetForceDestroy() { this._forceDestroy = undefined; } // Temporarily expose input value. Use with caution. get forceDestroyInput() { return this._forceDestroy; } 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() { return this._labels; } get name() { return this.getStringAttribute('name'); } set name(value) { this._name = value; } resetName() { this._name = undefined; } // Temporarily expose input value. Use with caution. get nameInput() { return this._name; } get numNodes() { return this.getNumberAttribute('num_nodes'); } set numNodes(value) { this._numNodes = value; } resetNumNodes() {