UNPKG

@cdktf/provider-google

Version:

Prebuilt google Provider for Terraform CDK (cdktf)

1,278 lines 197 kB
"use strict"; var _a, _b, _c, _d, _e, _f, _g, _h; Object.defineProperty(exports, "__esModule", { value: true }); exports.ComputeRouterNat = exports.ComputeRouterNatTimeoutsOutputReference = exports.ComputeRouterNatSubnetworkList = exports.ComputeRouterNatSubnetworkOutputReference = exports.ComputeRouterNatRulesList = exports.ComputeRouterNatRulesOutputReference = exports.ComputeRouterNatRulesActionOutputReference = exports.ComputeRouterNatLogConfigOutputReference = void 0; exports.computeRouterNatLogConfigToTerraform = computeRouterNatLogConfigToTerraform; exports.computeRouterNatLogConfigToHclTerraform = computeRouterNatLogConfigToHclTerraform; exports.computeRouterNatRulesActionToTerraform = computeRouterNatRulesActionToTerraform; exports.computeRouterNatRulesActionToHclTerraform = computeRouterNatRulesActionToHclTerraform; exports.computeRouterNatRulesToTerraform = computeRouterNatRulesToTerraform; exports.computeRouterNatRulesToHclTerraform = computeRouterNatRulesToHclTerraform; exports.computeRouterNatSubnetworkToTerraform = computeRouterNatSubnetworkToTerraform; exports.computeRouterNatSubnetworkToHclTerraform = computeRouterNatSubnetworkToHclTerraform; exports.computeRouterNatTimeoutsToTerraform = computeRouterNatTimeoutsToTerraform; exports.computeRouterNatTimeoutsToHclTerraform = computeRouterNatTimeoutsToHclTerraform; const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti"); const cdktf = require("cdktf"); function computeRouterNatLogConfigToTerraform(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: cdktf.booleanToTerraform(struct.enable), filter: cdktf.stringToTerraform(struct.filter), }; } function computeRouterNatLogConfigToHclTerraform(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: { value: cdktf.booleanToHclTerraform(struct.enable), isBlock: false, type: "simple", storageClassType: "boolean", }, filter: { value: cdktf.stringToHclTerraform(struct.filter), isBlock: false, type: "simple", storageClassType: "string", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class ComputeRouterNatLogConfigOutputReference 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._enable !== undefined) { hasAnyValues = true; internalValueResult.enable = this._enable; } if (this._filter !== undefined) { hasAnyValues = true; internalValueResult.filter = this._filter; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._enable = undefined; this._filter = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._enable = value.enable; this._filter = value.filter; } } get enable() { return this.getBooleanAttribute('enable'); } set enable(value) { this._enable = value; } // Temporarily expose input value. Use with caution. get enableInput() { return this._enable; } get filter() { return this.getStringAttribute('filter'); } set filter(value) { this._filter = value; } // Temporarily expose input value. Use with caution. get filterInput() { return this._filter; } } exports.ComputeRouterNatLogConfigOutputReference = ComputeRouterNatLogConfigOutputReference; _a = JSII_RTTI_SYMBOL_1; ComputeRouterNatLogConfigOutputReference[_a] = { fqn: "@cdktf/provider-google.computeRouterNat.ComputeRouterNatLogConfigOutputReference", version: "14.35.0" }; function computeRouterNatRulesActionToTerraform(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 { source_nat_active_ips: cdktf.listMapper(cdktf.stringToTerraform, false)(struct.sourceNatActiveIps), source_nat_active_ranges: cdktf.listMapper(cdktf.stringToTerraform, false)(struct.sourceNatActiveRanges), source_nat_drain_ips: cdktf.listMapper(cdktf.stringToTerraform, false)(struct.sourceNatDrainIps), source_nat_drain_ranges: cdktf.listMapper(cdktf.stringToTerraform, false)(struct.sourceNatDrainRanges), }; } function computeRouterNatRulesActionToHclTerraform(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 = { source_nat_active_ips: { value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct.sourceNatActiveIps), isBlock: false, type: "set", storageClassType: "stringList", }, source_nat_active_ranges: { value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct.sourceNatActiveRanges), isBlock: false, type: "set", storageClassType: "stringList", }, source_nat_drain_ips: { value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct.sourceNatDrainIps), isBlock: false, type: "set", storageClassType: "stringList", }, source_nat_drain_ranges: { value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct.sourceNatDrainRanges), isBlock: false, type: "set", storageClassType: "stringList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class ComputeRouterNatRulesActionOutputReference 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._sourceNatActiveIps !== undefined) { hasAnyValues = true; internalValueResult.sourceNatActiveIps = this._sourceNatActiveIps; } if (this._sourceNatActiveRanges !== undefined) { hasAnyValues = true; internalValueResult.sourceNatActiveRanges = this._sourceNatActiveRanges; } if (this._sourceNatDrainIps !== undefined) { hasAnyValues = true; internalValueResult.sourceNatDrainIps = this._sourceNatDrainIps; } if (this._sourceNatDrainRanges !== undefined) { hasAnyValues = true; internalValueResult.sourceNatDrainRanges = this._sourceNatDrainRanges; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._sourceNatActiveIps = undefined; this._sourceNatActiveRanges = undefined; this._sourceNatDrainIps = undefined; this._sourceNatDrainRanges = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._sourceNatActiveIps = value.sourceNatActiveIps; this._sourceNatActiveRanges = value.sourceNatActiveRanges; this._sourceNatDrainIps = value.sourceNatDrainIps; this._sourceNatDrainRanges = value.sourceNatDrainRanges; } } get sourceNatActiveIps() { return cdktf.Fn.tolist(this.getListAttribute('source_nat_active_ips')); } set sourceNatActiveIps(value) { this._sourceNatActiveIps = value; } resetSourceNatActiveIps() { this._sourceNatActiveIps = undefined; } // Temporarily expose input value. Use with caution. get sourceNatActiveIpsInput() { return this._sourceNatActiveIps; } get sourceNatActiveRanges() { return cdktf.Fn.tolist(this.getListAttribute('source_nat_active_ranges')); } set sourceNatActiveRanges(value) { this._sourceNatActiveRanges = value; } resetSourceNatActiveRanges() { this._sourceNatActiveRanges = undefined; } // Temporarily expose input value. Use with caution. get sourceNatActiveRangesInput() { return this._sourceNatActiveRanges; } get sourceNatDrainIps() { return cdktf.Fn.tolist(this.getListAttribute('source_nat_drain_ips')); } set sourceNatDrainIps(value) { this._sourceNatDrainIps = value; } resetSourceNatDrainIps() { this._sourceNatDrainIps = undefined; } // Temporarily expose input value. Use with caution. get sourceNatDrainIpsInput() { return this._sourceNatDrainIps; } get sourceNatDrainRanges() { return cdktf.Fn.tolist(this.getListAttribute('source_nat_drain_ranges')); } set sourceNatDrainRanges(value) { this._sourceNatDrainRanges = value; } resetSourceNatDrainRanges() { this._sourceNatDrainRanges = undefined; } // Temporarily expose input value. Use with caution. get sourceNatDrainRangesInput() { return this._sourceNatDrainRanges; } } exports.ComputeRouterNatRulesActionOutputReference = ComputeRouterNatRulesActionOutputReference; _b = JSII_RTTI_SYMBOL_1; ComputeRouterNatRulesActionOutputReference[_b] = { fqn: "@cdktf/provider-google.computeRouterNat.ComputeRouterNatRulesActionOutputReference", version: "14.35.0" }; function computeRouterNatRulesToTerraform(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 { description: cdktf.stringToTerraform(struct.description), match: cdktf.stringToTerraform(struct.match), rule_number: cdktf.numberToTerraform(struct.ruleNumber), action: computeRouterNatRulesActionToTerraform(struct.action), }; } function computeRouterNatRulesToHclTerraform(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 = { description: { value: cdktf.stringToHclTerraform(struct.description), isBlock: false, type: "simple", storageClassType: "string", }, match: { value: cdktf.stringToHclTerraform(struct.match), isBlock: false, type: "simple", storageClassType: "string", }, rule_number: { value: cdktf.numberToHclTerraform(struct.ruleNumber), isBlock: false, type: "simple", storageClassType: "number", }, action: { value: computeRouterNatRulesActionToHclTerraform(struct.action), isBlock: true, type: "list", storageClassType: "ComputeRouterNatRulesActionList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class ComputeRouterNatRulesOutputReference 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; // action - computed: false, optional: true, required: false this._action = new ComputeRouterNatRulesActionOutputReference(this, "action"); } get internalValue() { if (this.resolvableValue) { return this.resolvableValue; } let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._description !== undefined) { hasAnyValues = true; internalValueResult.description = this._description; } if (this._match !== undefined) { hasAnyValues = true; internalValueResult.match = this._match; } if (this._ruleNumber !== undefined) { hasAnyValues = true; internalValueResult.ruleNumber = this._ruleNumber; } if (this._action?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.action = this._action?.internalValue; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this.resolvableValue = undefined; this._description = undefined; this._match = undefined; this._ruleNumber = undefined; this._action.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._description = value.description; this._match = value.match; this._ruleNumber = value.ruleNumber; this._action.internalValue = value.action; } } get description() { return this.getStringAttribute('description'); } set description(value) { this._description = value; } resetDescription() { this._description = undefined; } // Temporarily expose input value. Use with caution. get descriptionInput() { return this._description; } get match() { return this.getStringAttribute('match'); } set match(value) { this._match = value; } // Temporarily expose input value. Use with caution. get matchInput() { return this._match; } get ruleNumber() { return this.getNumberAttribute('rule_number'); } set ruleNumber(value) { this._ruleNumber = value; } // Temporarily expose input value. Use with caution. get ruleNumberInput() { return this._ruleNumber; } get action() { return this._action; } putAction(value) { this._action.internalValue = value; } resetAction() { this._action.internalValue = undefined; } // Temporarily expose input value. Use with caution. get actionInput() { return this._action.internalValue; } } exports.ComputeRouterNatRulesOutputReference = ComputeRouterNatRulesOutputReference; _c = JSII_RTTI_SYMBOL_1; ComputeRouterNatRulesOutputReference[_c] = { fqn: "@cdktf/provider-google.computeRouterNat.ComputeRouterNatRulesOutputReference", version: "14.35.0" }; class ComputeRouterNatRulesList 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 ComputeRouterNatRulesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); } } exports.ComputeRouterNatRulesList = ComputeRouterNatRulesList; _d = JSII_RTTI_SYMBOL_1; ComputeRouterNatRulesList[_d] = { fqn: "@cdktf/provider-google.computeRouterNat.ComputeRouterNatRulesList", version: "14.35.0" }; function computeRouterNatSubnetworkToTerraform(struct) { if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } return { name: cdktf.stringToTerraform(struct.name), secondary_ip_range_names: cdktf.listMapper(cdktf.stringToTerraform, false)(struct.secondaryIpRangeNames), source_ip_ranges_to_nat: cdktf.listMapper(cdktf.stringToTerraform, false)(struct.sourceIpRangesToNat), }; } function computeRouterNatSubnetworkToHclTerraform(struct) { if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } const attrs = { name: { value: cdktf.stringToHclTerraform(struct.name), isBlock: false, type: "simple", storageClassType: "string", }, secondary_ip_range_names: { value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct.secondaryIpRangeNames), isBlock: false, type: "set", storageClassType: "stringList", }, source_ip_ranges_to_nat: { value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct.sourceIpRangesToNat), isBlock: false, type: "set", storageClassType: "stringList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class ComputeRouterNatSubnetworkOutputReference 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._name !== undefined) { hasAnyValues = true; internalValueResult.name = this._name; } if (this._secondaryIpRangeNames !== undefined) { hasAnyValues = true; internalValueResult.secondaryIpRangeNames = this._secondaryIpRangeNames; } if (this._sourceIpRangesToNat !== undefined) { hasAnyValues = true; internalValueResult.sourceIpRangesToNat = this._sourceIpRangesToNat; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this.resolvableValue = undefined; this._name = undefined; this._secondaryIpRangeNames = undefined; this._sourceIpRangesToNat = undefined; } else if (cdktf.Tokenization.isResolvable(value)) { this.isEmptyObject = false; this.resolvableValue = value; } else { this.isEmptyObject = Object.keys(value).length === 0; this.resolvableValue = undefined; this._name = value.name; this._secondaryIpRangeNames = value.secondaryIpRangeNames; this._sourceIpRangesToNat = value.sourceIpRangesToNat; } } 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 secondaryIpRangeNames() { return cdktf.Fn.tolist(this.getListAttribute('secondary_ip_range_names')); } set secondaryIpRangeNames(value) { this._secondaryIpRangeNames = value; } resetSecondaryIpRangeNames() { this._secondaryIpRangeNames = undefined; } // Temporarily expose input value. Use with caution. get secondaryIpRangeNamesInput() { return this._secondaryIpRangeNames; } get sourceIpRangesToNat() { return cdktf.Fn.tolist(this.getListAttribute('source_ip_ranges_to_nat')); } set sourceIpRangesToNat(value) { this._sourceIpRangesToNat = value; } // Temporarily expose input value. Use with caution. get sourceIpRangesToNatInput() { return this._sourceIpRangesToNat; } } exports.ComputeRouterNatSubnetworkOutputReference = ComputeRouterNatSubnetworkOutputReference; _e = JSII_RTTI_SYMBOL_1; ComputeRouterNatSubnetworkOutputReference[_e] = { fqn: "@cdktf/provider-google.computeRouterNat.ComputeRouterNatSubnetworkOutputReference", version: "14.35.0" }; class ComputeRouterNatSubnetworkList 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 ComputeRouterNatSubnetworkOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); } } exports.ComputeRouterNatSubnetworkList = ComputeRouterNatSubnetworkList; _f = JSII_RTTI_SYMBOL_1; ComputeRouterNatSubnetworkList[_f] = { fqn: "@cdktf/provider-google.computeRouterNat.ComputeRouterNatSubnetworkList", version: "14.35.0" }; function computeRouterNatTimeoutsToTerraform(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), }; } function computeRouterNatTimeoutsToHclTerraform(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)); } class ComputeRouterNatTimeoutsOutputReference 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.ComputeRouterNatTimeoutsOutputReference = ComputeRouterNatTimeoutsOutputReference; _g = JSII_RTTI_SYMBOL_1; ComputeRouterNatTimeoutsOutputReference[_g] = { fqn: "@cdktf/provider-google.computeRouterNat.ComputeRouterNatTimeoutsOutputReference", version: "14.35.0" }; /** * Represents a {@link https://registry.terraform.io/providers/hashicorp/google/6.36.0/docs/resources/compute_router_nat google_compute_router_nat} */ class ComputeRouterNat extends cdktf.TerraformResource { // ============== // STATIC Methods // ============== /** * Generates CDKTF code for importing a ComputeRouterNat 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 ComputeRouterNat to import * @param importFromId The id of the existing ComputeRouterNat that should be imported. Refer to the {@link https://registry.terraform.io/providers/hashicorp/google/6.36.0/docs/resources/compute_router_nat#import import section} in the documentation of this resource for the id to use * @param provider? Optional instance of the provider where the ComputeRouterNat to import is found */ static generateConfigForImport(scope, importToId, importFromId, provider) { return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "google_compute_router_nat", importId: importFromId, provider }); } // =========== // INITIALIZER // =========== /** * Create a new {@link https://registry.terraform.io/providers/hashicorp/google/6.36.0/docs/resources/compute_router_nat google_compute_router_nat} 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 ComputeRouterNatConfig */ constructor(scope, id, config) { super(scope, id, { terraformResourceType: 'google_compute_router_nat', terraformGeneratorMetadata: { providerName: 'google', providerVersion: '6.36.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 }); // log_config - computed: false, optional: true, required: false this._logConfig = new ComputeRouterNatLogConfigOutputReference(this, "log_config"); // rules - computed: false, optional: true, required: false this._rules = new ComputeRouterNatRulesList(this, "rules", true); // subnetwork - computed: false, optional: true, required: false this._subnetwork = new ComputeRouterNatSubnetworkList(this, "subnetwork", true); // timeouts - computed: false, optional: true, required: false this._timeouts = new ComputeRouterNatTimeoutsOutputReference(this, "timeouts"); this._autoNetworkTier = config.autoNetworkTier; this._drainNatIps = config.drainNatIps; this._enableDynamicPortAllocation = config.enableDynamicPortAllocation; this._enableEndpointIndependentMapping = config.enableEndpointIndependentMapping; this._endpointTypes = config.endpointTypes; this._icmpIdleTimeoutSec = config.icmpIdleTimeoutSec; this._id = config.id; this._initialNatIps = config.initialNatIps; this._maxPortsPerVm = config.maxPortsPerVm; this._minPortsPerVm = config.minPortsPerVm; this._name = config.name; this._natIpAllocateOption = config.natIpAllocateOption; this._natIps = config.natIps; this._project = config.project; this._region = config.region; this._router = config.router; this._sourceSubnetworkIpRangesToNat = config.sourceSubnetworkIpRangesToNat; this._tcpEstablishedIdleTimeoutSec = config.tcpEstablishedIdleTimeoutSec; this._tcpTimeWaitTimeoutSec = config.tcpTimeWaitTimeoutSec; this._tcpTransitoryIdleTimeoutSec = config.tcpTransitoryIdleTimeoutSec; this._type = config.type; this._udpIdleTimeoutSec = config.udpIdleTimeoutSec; this._logConfig.internalValue = config.logConfig; this._rules.internalValue = config.rules; this._subnetwork.internalValue = config.subnetwork; this._timeouts.internalValue = config.timeouts; } get autoNetworkTier() { return this.getStringAttribute('auto_network_tier'); } set autoNetworkTier(value) { this._autoNetworkTier = value; } resetAutoNetworkTier() { this._autoNetworkTier = undefined; } // Temporarily expose input value. Use with caution. get autoNetworkTierInput() { return this._autoNetworkTier; } get drainNatIps() { return cdktf.Fn.tolist(this.getListAttribute('drain_nat_ips')); } set drainNatIps(value) { this._drainNatIps = value; } resetDrainNatIps() { this._drainNatIps = undefined; } // Temporarily expose input value. Use with caution. get drainNatIpsInput() { return this._drainNatIps; } get enableDynamicPortAllocation() { return this.getBooleanAttribute('enable_dynamic_port_allocation'); } set enableDynamicPortAllocation(value) { this._enableDynamicPortAllocation = value; } resetEnableDynamicPortAllocation() { this._enableDynamicPortAllocation = undefined; } // Temporarily expose input value. Use with caution. get enableDynamicPortAllocationInput() { return this._enableDynamicPortAllocation; } get enableEndpointIndependentMapping() { return this.getBooleanAttribute('enable_endpoint_independent_mapping'); } set enableEndpointIndependentMapping(value) { this._enableEndpointIndependentMapping = value; } resetEnableEndpointIndependentMapping() { this._enableEndpointIndependentMapping = undefined; } // Temporarily expose input value. Use with caution. get enableEndpointIndependentMappingInput() { return this._enableEndpointIndependentMapping; } get endpointTypes() { return this.getListAttribute('endpoint_types'); } set endpointTypes(value) { this._endpointTypes = value; } resetEndpointTypes() { this._endpointTypes = undefined; } // Temporarily expose input value. Use with caution. get endpointTypesInput() { return this._endpointTypes; } get icmpIdleTimeoutSec() { return this.getNumberAttribute('icmp_idle_timeout_sec'); } set icmpIdleTimeoutSec(value) { this._icmpIdleTimeoutSec = value; } resetIcmpIdleTimeoutSec() { this._icmpIdleTimeoutSec = undefined; } // Temporarily expose input value. Use with caution. get icmpIdleTimeoutSecInput() { return this._icmpIdleTimeoutSec; } 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 initialNatIps() { return cdktf.Fn.tolist(this.getListAttribute('initial_nat_ips')); } set initialNatIps(value) { this._initialNatIps = value; } resetInitialNatIps() { this._initialNatIps = undefined; } // Temporarily expose input value. Use with caution. get initialNatIpsInput() { return this._initialNatIps; } get maxPortsPerVm() { return this.getNumberAttribute('max_ports_per_vm'); } set maxPortsPerVm(value) { this._maxPortsPerVm = value; } resetMaxPortsPerVm() { this._maxPortsPerVm = undefined; } // Temporarily expose input value. Use with caution. get maxPortsPerVmInput() { return this._maxPortsPerVm; } get minPortsPerVm() { return this.getNumberAttribute('min_ports_per_vm'); } set minPortsPerVm(value) { this._minPortsPerVm = value; } resetMinPortsPerVm() { this._minPortsPerVm = undefined; } // Temporarily expose input value. Use with caution. get minPortsPerVmInput() { return this._minPortsPerVm; } 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 natIpAllocateOption() { return this.getStringAttribute('nat_ip_allocate_option'); } set natIpAllocateOption(value) { this._natIpAllocateOption = value; } resetNatIpAllocateOption() { this._natIpAllocateOption = undefined; } // Temporarily expose input value. Use with caution. get natIpAllocateOptionInput() { return this._natIpAllocateOption; } get natIps() { return cdktf.Fn.tolist(this.getListAttribute('nat_ips')); } set natIps(value) { this._natIps = value; } resetNatIps() { this._natIps = undefined; } // Temporarily expose input value. Use with caution. get natIpsInput() { return this._natIps; } get project() { return this.getStringAttribute('project'); } set project(value) { this._project = value; } resetProject() { this._project = undefined; } // Temporarily expose input value. Use with caution. get projectInput() { return this._project; } get region() { return this.getStringAttribute('region'); } set region(value) { this._region = value; } resetRegion() { this._region = undefined; } // Temporarily expose input value. Use with caution. get regionInput() { return this._region; } get router() { return this.getStringAttribute('router'); } set router(value) { this._router = value; } // Temporarily expose input value. Use with caution. get routerInput() { return this._router; } get sourceSubnetworkIpRangesToNat() { return this.getStringAttribute('source_subnetwork_ip_ranges_to_nat'); } set sourceSubnetworkIpRangesToNat(value) { this._sourceSubnetworkIpRangesToNat = value; } // Temporarily expose input value. Use with caution. get sourceSubnetworkIpRangesToNatInput() { return this._sourceSubnetworkIpRangesToNat; } get tcpEstablishedIdleTimeoutSec() { return this.getNumberAttribute('tcp_established_idle_timeout_sec'); } set tcpEstablishedIdleTimeoutSec(value) { this._tcpEstablishedIdleTimeoutSec = value; } resetTcpEstablishedIdleTimeoutSec() { this._tcpEstablishedIdleTimeoutSec = undefined; } // Temporarily expose input value. Use with caution. get tcpEstablishedIdleTimeoutSecInput() { return this._tcpEstablishedIdleTimeoutSec; } get tcpTimeWaitTimeoutSec() { return this.getNumberAttribute('tcp_time_wait_timeout_sec'); } set tcpTimeWaitTimeoutSec(value) { this._tcpTimeWaitTimeoutSec = value; } resetTcpTimeWaitTimeoutSec() { this._tcpTimeWaitTimeoutSec = undefined; } // Temporarily expose input value. Use with caution. get tcpTimeWaitTimeoutSecInput() { return this._tcpTimeWaitTimeoutSec; } get tcpTransitoryIdleTimeoutSec() { return this.getNumberAttribute('tcp_transitory_idle_timeout_sec'); } set tcpTransitoryIdleTimeoutSec(value) { this._tcpTransitoryIdleTimeoutSec = value; } resetTcpTransitoryIdleTimeoutSec() { this._tcpTransitoryIdleTimeoutSec = undefined; } // Temporarily expose input value. Use with caution. get tcpTransitoryIdleTimeoutSecInput() { return this._tcpTransitoryIdleTimeoutSec; } get type() { return this.getStringAttribute('type'); } set type(value) { this._type = value; } resetType() { this._type = undefined; } // Temporarily expose input value. Use with caution. get typeInput() { return this._type; } get udpIdleTimeoutSec() { return this.getNumberAttribute('udp_idle_timeout_sec'); } set udpIdleTimeoutSec(value) { this._udpIdleTimeoutSec = value; } resetUdpIdleTimeoutSec() { this._udpIdleTimeoutSec = undefined; } // Temporarily expose input value. Use with caution. get udpIdleTimeoutSecInput() { return this._udpIdleTimeoutSec; } get logConfig() { return this._logConfig; } putLogConfig(value) { this._logConfig.internalValue = value; } resetLogConfig() { this._logConfig.internalValue = undefined; } // Temporarily expose input value. Use with caution. get logConfigInput() { return this._logConfig.internalValue; } get rules() { return this._rules; } putRules(value) { this._rules.internalValue = value; } resetRules() { this._rules.internalValue = undefined; } // Temporarily expose input value. Use with caution. get rulesInput() { return this._rules.internalValue; } get subnetwork() { return this._subnetwork; } putSubnetwork(value) { this._subnetwork.internalValue = value; } resetSubnetwork() { this._subnetwork.internalValue = undefined; } // Temporarily expose input value. Use with caution. get subnetworkInput() { return this._subnetwork.internalValue; } get timeouts() { return this._timeouts; } putTimeouts(value) { this._timeouts.internalValue = value; } resetTimeouts() { this._timeouts.internalValue = undefined; } // Temporarily expose input value. Use with caution. get timeoutsInput() { return this._timeouts.internalValue; } // ========= // SYNTHESIS // ========= synthesizeAttributes() { return { auto_network_tier: cdktf.stringToTerraform(this._autoNetworkTier), drain_nat_ips: cdktf.listMapper(cdktf.stringToTerraform, false)(this._drainNatIps), enable_dynamic_port_allocation: cdktf.booleanToTerraform(this._enableDynamicPortAllocation), enable_endpoint_independent_mapping: cdktf.booleanToTerraform(this._enableEndpointIndependentMapping), endpoint_types: cdktf.listMapper(cdktf.stringToTerraform, false)(this._endpointTypes), icmp_idle_timeout_sec: cdktf.numberToTerraform(this._icmpIdleTimeoutSec), id: cdktf.stringToTerraform(this._id), initial_nat_ips: cdktf.listMapper(cdktf.stringToTerraform, false)(this._initialNatIps), max_ports_per_vm: cdktf.numberToTerraform(this._maxPortsPerVm), min_ports_per_vm: cdktf.numberToTerraform(this._minPortsPerVm), name: cdktf.stringToTerraform(this._name), nat_ip_allocate_option: cdktf.stringToTerraform(this._natIpAllocateOption), nat_ips: cdktf.listMapper(cdktf.stringToTerraform, false)(this._natIps), project: cdktf.stringToTerraform(this._project), region: cdktf.stringToTerraform(this._region), router: cdktf.stringToTerraform(this._router), source_subnetwork_ip_ranges_to_nat: cdktf.stringToTerraform(this._sourceSubnetworkIpRangesToNat), tcp_established_idle_timeout_sec: cdktf.numberToTerraform(this._tcpEstablishedIdleTimeoutSec), tcp_time_wait_timeout_sec: cdktf.numberToTerraform(this._tcpTimeWaitTimeoutSec), tcp_transitory_idle_timeout_sec: cdktf.numberToTerraform(this._tcpTransitoryIdleTimeoutSec), type: cdktf.stringToTerraform(this._type), udp_idle_timeout_sec: cdktf.numberToTerraform(this._udpIdleTimeoutSec), log_config: computeRouterNatLogConfigToTerraform(this._logConfig.internalValue), rules: cdktf.listMapper(computeRouterNatRulesToTerraform, true)(this._rules.internalValue), subnetwork: cdktf.listMapper(computeRouterNatSubnetworkToTerraform, true)(this._subnetwork.internalValue), timeouts: computeRouterNatTimeoutsToTerraform(this._timeouts.internalValue), }; } synthesizeHclAttributes() { const attrs = { auto_network_tier: { value: cdktf.stringToHclTerraform(this._autoNetworkTier), isBlock: false, type: "simple", storageClassType: "string", }, drain_nat_ips: { value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._drainNatIps), isBlock: false, type: "set", storageClassType: "stringList", }, enable_dynamic_port_allocation: { value: cdktf.booleanToHclTerraform(this._enableDynamicPortAllocation), isBlock: false, type: "simple", storageClassType: "boolean", }, enable_endpoint_independent_mapping: { value: cdktf.booleanToHclTerraform(this._enableEndpointIndependentMapping), isBlock: false, type: "simple", storageClassType: "boolean", }, endpoint_types: { value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._endpointTypes), isBlock: false, type: "list", storageClassType: "stringList", }, icmp_idle_timeout_sec: { value: cdktf.numberToHclTerraform(this._icmpIdleTimeoutSec), isBlock: false, type: "simple", storageClassType: "number", }, id: { value: cdktf.stringToHclTerraform(this._id), isBlock: false, type: "simple", storageClassType: "string", }, initial_nat_ips: { value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._initialNatIps), isBlock: false, type: "set", storageClassType: "stringList", }, max_ports_per_vm: { value: cdktf.numberToHclTerraform(this._maxPortsPerVm), isBlock: false, type: "simple", storageClassType: "number", }, min_ports_per_vm: { value: cdktf.numberToHclTerraform(this._minPortsPerVm), isBlock: false, type: "simple", storageClassType: "number", }, name: { value: cdktf.stringToHclTerraform(this._name), isBlock: false, type: "simple", storageClassType: "string", }, nat_ip_allocate_option: { value: cdktf.stringToHclTerraform(this._natIpAllocateOption), isBlock: false, type: "simple", storageClassType: "string", }, nat_ips: { value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._natIps), isBlock: false, type: "set", storageClassType: "stringList", }, project: { value: cdktf.stringToHclTerraform(this._project), isBlock: false, type: "simple", storageClassType: "string", }, region: { value: cdktf.stringToHclTerraform(this._region), isBlock: false, type: "simple", storageClassType: "string", }, router: { value: cdktf.stringToHclTerraform(this._router), isBlock: false, type: "simple", storageClassType: "string", }, source_subnetwork_ip_ranges_to_nat: { value: cdktf.stringToHclTerraform(this._sourceSubnetworkIpRangesToNat), isBlock: false, type: "simple", storageClassType: "string", }, tcp_established_idle_timeout_sec: { value: cdktf.numberToHclTerraform(this._tcpEstablishedIdleTimeoutSec), i