UNPKG

@cdktf/provider-kubernetes

Version:

Prebuilt kubernetes Provider for Terraform CDK (cdktf)

1,135 lines 420 kB
"use strict"; var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7; Object.defineProperty(exports, "__esModule", { value: true }); exports.NetworkPolicy = exports.NetworkPolicySpecOutputReference = exports.NetworkPolicySpecPodSelectorOutputReference = exports.NetworkPolicySpecPodSelectorMatchExpressionsList = exports.NetworkPolicySpecPodSelectorMatchExpressionsOutputReference = exports.NetworkPolicySpecIngressList = exports.NetworkPolicySpecIngressOutputReference = exports.NetworkPolicySpecIngressPortsList = exports.NetworkPolicySpecIngressPortsOutputReference = exports.NetworkPolicySpecIngressFromList = exports.NetworkPolicySpecIngressFromOutputReference = exports.NetworkPolicySpecIngressFromPodSelectorOutputReference = exports.NetworkPolicySpecIngressFromPodSelectorMatchExpressionsList = exports.NetworkPolicySpecIngressFromPodSelectorMatchExpressionsOutputReference = exports.NetworkPolicySpecIngressFromNamespaceSelectorOutputReference = exports.NetworkPolicySpecIngressFromNamespaceSelectorMatchExpressionsList = exports.NetworkPolicySpecIngressFromNamespaceSelectorMatchExpressionsOutputReference = exports.NetworkPolicySpecIngressFromIpBlockOutputReference = exports.NetworkPolicySpecEgressList = exports.NetworkPolicySpecEgressOutputReference = exports.NetworkPolicySpecEgressToList = exports.NetworkPolicySpecEgressToOutputReference = exports.NetworkPolicySpecEgressToPodSelectorOutputReference = exports.NetworkPolicySpecEgressToPodSelectorMatchExpressionsList = exports.NetworkPolicySpecEgressToPodSelectorMatchExpressionsOutputReference = exports.NetworkPolicySpecEgressToNamespaceSelectorOutputReference = exports.NetworkPolicySpecEgressToNamespaceSelectorMatchExpressionsList = exports.NetworkPolicySpecEgressToNamespaceSelectorMatchExpressionsOutputReference = exports.NetworkPolicySpecEgressToIpBlockOutputReference = exports.NetworkPolicySpecEgressPortsList = exports.NetworkPolicySpecEgressPortsOutputReference = exports.NetworkPolicyMetadataOutputReference = void 0; exports.networkPolicyMetadataToTerraform = networkPolicyMetadataToTerraform; exports.networkPolicyMetadataToHclTerraform = networkPolicyMetadataToHclTerraform; exports.networkPolicySpecEgressPortsToTerraform = networkPolicySpecEgressPortsToTerraform; exports.networkPolicySpecEgressPortsToHclTerraform = networkPolicySpecEgressPortsToHclTerraform; exports.networkPolicySpecEgressToIpBlockToTerraform = networkPolicySpecEgressToIpBlockToTerraform; exports.networkPolicySpecEgressToIpBlockToHclTerraform = networkPolicySpecEgressToIpBlockToHclTerraform; exports.networkPolicySpecEgressToNamespaceSelectorMatchExpressionsToTerraform = networkPolicySpecEgressToNamespaceSelectorMatchExpressionsToTerraform; exports.networkPolicySpecEgressToNamespaceSelectorMatchExpressionsToHclTerraform = networkPolicySpecEgressToNamespaceSelectorMatchExpressionsToHclTerraform; exports.networkPolicySpecEgressToNamespaceSelectorToTerraform = networkPolicySpecEgressToNamespaceSelectorToTerraform; exports.networkPolicySpecEgressToNamespaceSelectorToHclTerraform = networkPolicySpecEgressToNamespaceSelectorToHclTerraform; exports.networkPolicySpecEgressToPodSelectorMatchExpressionsToTerraform = networkPolicySpecEgressToPodSelectorMatchExpressionsToTerraform; exports.networkPolicySpecEgressToPodSelectorMatchExpressionsToHclTerraform = networkPolicySpecEgressToPodSelectorMatchExpressionsToHclTerraform; exports.networkPolicySpecEgressToPodSelectorToTerraform = networkPolicySpecEgressToPodSelectorToTerraform; exports.networkPolicySpecEgressToPodSelectorToHclTerraform = networkPolicySpecEgressToPodSelectorToHclTerraform; exports.networkPolicySpecEgressToToTerraform = networkPolicySpecEgressToToTerraform; exports.networkPolicySpecEgressToToHclTerraform = networkPolicySpecEgressToToHclTerraform; exports.networkPolicySpecEgressToTerraform = networkPolicySpecEgressToTerraform; exports.networkPolicySpecEgressToHclTerraform = networkPolicySpecEgressToHclTerraform; exports.networkPolicySpecIngressFromIpBlockToTerraform = networkPolicySpecIngressFromIpBlockToTerraform; exports.networkPolicySpecIngressFromIpBlockToHclTerraform = networkPolicySpecIngressFromIpBlockToHclTerraform; exports.networkPolicySpecIngressFromNamespaceSelectorMatchExpressionsToTerraform = networkPolicySpecIngressFromNamespaceSelectorMatchExpressionsToTerraform; exports.networkPolicySpecIngressFromNamespaceSelectorMatchExpressionsToHclTerraform = networkPolicySpecIngressFromNamespaceSelectorMatchExpressionsToHclTerraform; exports.networkPolicySpecIngressFromNamespaceSelectorToTerraform = networkPolicySpecIngressFromNamespaceSelectorToTerraform; exports.networkPolicySpecIngressFromNamespaceSelectorToHclTerraform = networkPolicySpecIngressFromNamespaceSelectorToHclTerraform; exports.networkPolicySpecIngressFromPodSelectorMatchExpressionsToTerraform = networkPolicySpecIngressFromPodSelectorMatchExpressionsToTerraform; exports.networkPolicySpecIngressFromPodSelectorMatchExpressionsToHclTerraform = networkPolicySpecIngressFromPodSelectorMatchExpressionsToHclTerraform; exports.networkPolicySpecIngressFromPodSelectorToTerraform = networkPolicySpecIngressFromPodSelectorToTerraform; exports.networkPolicySpecIngressFromPodSelectorToHclTerraform = networkPolicySpecIngressFromPodSelectorToHclTerraform; exports.networkPolicySpecIngressFromToTerraform = networkPolicySpecIngressFromToTerraform; exports.networkPolicySpecIngressFromToHclTerraform = networkPolicySpecIngressFromToHclTerraform; exports.networkPolicySpecIngressPortsToTerraform = networkPolicySpecIngressPortsToTerraform; exports.networkPolicySpecIngressPortsToHclTerraform = networkPolicySpecIngressPortsToHclTerraform; exports.networkPolicySpecIngressToTerraform = networkPolicySpecIngressToTerraform; exports.networkPolicySpecIngressToHclTerraform = networkPolicySpecIngressToHclTerraform; exports.networkPolicySpecPodSelectorMatchExpressionsToTerraform = networkPolicySpecPodSelectorMatchExpressionsToTerraform; exports.networkPolicySpecPodSelectorMatchExpressionsToHclTerraform = networkPolicySpecPodSelectorMatchExpressionsToHclTerraform; exports.networkPolicySpecPodSelectorToTerraform = networkPolicySpecPodSelectorToTerraform; exports.networkPolicySpecPodSelectorToHclTerraform = networkPolicySpecPodSelectorToHclTerraform; exports.networkPolicySpecToTerraform = networkPolicySpecToTerraform; exports.networkPolicySpecToHclTerraform = networkPolicySpecToHclTerraform; const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti"); const cdktf = require("cdktf"); function networkPolicyMetadataToTerraform(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 { annotations: cdktf.hashMapper(cdktf.stringToTerraform)(struct.annotations), generate_name: cdktf.stringToTerraform(struct.generateName), labels: cdktf.hashMapper(cdktf.stringToTerraform)(struct.labels), name: cdktf.stringToTerraform(struct.name), namespace: cdktf.stringToTerraform(struct.namespace), }; } function networkPolicyMetadataToHclTerraform(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 = { annotations: { value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct.annotations), isBlock: false, type: "map", storageClassType: "stringMap", }, generate_name: { value: cdktf.stringToHclTerraform(struct.generateName), isBlock: false, type: "simple", storageClassType: "string", }, labels: { value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct.labels), isBlock: false, type: "map", storageClassType: "stringMap", }, name: { value: cdktf.stringToHclTerraform(struct.name), isBlock: false, type: "simple", storageClassType: "string", }, namespace: { value: cdktf.stringToHclTerraform(struct.namespace), isBlock: false, type: "simple", storageClassType: "string", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class NetworkPolicyMetadataOutputReference 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._annotations !== undefined) { hasAnyValues = true; internalValueResult.annotations = this._annotations; } if (this._generateName !== undefined) { hasAnyValues = true; internalValueResult.generateName = this._generateName; } if (this._labels !== undefined) { hasAnyValues = true; internalValueResult.labels = this._labels; } if (this._name !== undefined) { hasAnyValues = true; internalValueResult.name = this._name; } if (this._namespace !== undefined) { hasAnyValues = true; internalValueResult.namespace = this._namespace; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._annotations = undefined; this._generateName = undefined; this._labels = undefined; this._name = undefined; this._namespace = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._annotations = value.annotations; this._generateName = value.generateName; this._labels = value.labels; this._name = value.name; this._namespace = value.namespace; } } 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 generateName() { return this.getStringAttribute('generate_name'); } set generateName(value) { this._generateName = value; } resetGenerateName() { this._generateName = undefined; } // Temporarily expose input value. Use with caution. get generateNameInput() { return this._generateName; } // generation - computed: true, optional: false, required: false get generation() { return this.getNumberAttribute('generation'); } 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 namespace() { return this.getStringAttribute('namespace'); } set namespace(value) { this._namespace = value; } resetNamespace() { this._namespace = undefined; } // Temporarily expose input value. Use with caution. get namespaceInput() { return this._namespace; } // resource_version - computed: true, optional: false, required: false get resourceVersion() { return this.getStringAttribute('resource_version'); } // uid - computed: true, optional: false, required: false get uid() { return this.getStringAttribute('uid'); } } exports.NetworkPolicyMetadataOutputReference = NetworkPolicyMetadataOutputReference; _a = JSII_RTTI_SYMBOL_1; NetworkPolicyMetadataOutputReference[_a] = { fqn: "@cdktf/provider-kubernetes.networkPolicy.NetworkPolicyMetadataOutputReference", version: "12.0.0" }; function networkPolicySpecEgressPortsToTerraform(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 { end_port: cdktf.numberToTerraform(struct.endPort), port: cdktf.stringToTerraform(struct.port), protocol: cdktf.stringToTerraform(struct.protocol), }; } function networkPolicySpecEgressPortsToHclTerraform(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 = { end_port: { value: cdktf.numberToHclTerraform(struct.endPort), isBlock: false, type: "simple", storageClassType: "number", }, port: { value: cdktf.stringToHclTerraform(struct.port), isBlock: false, type: "simple", storageClassType: "string", }, protocol: { value: cdktf.stringToHclTerraform(struct.protocol), isBlock: false, type: "simple", storageClassType: "string", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class NetworkPolicySpecEgressPortsOutputReference 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._endPort !== undefined) { hasAnyValues = true; internalValueResult.endPort = this._endPort; } if (this._port !== undefined) { hasAnyValues = true; internalValueResult.port = this._port; } if (this._protocol !== undefined) { hasAnyValues = true; internalValueResult.protocol = this._protocol; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this.resolvableValue = undefined; this._endPort = undefined; this._port = undefined; this._protocol = 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._endPort = value.endPort; this._port = value.port; this._protocol = value.protocol; } } get endPort() { return this.getNumberAttribute('end_port'); } set endPort(value) { this._endPort = value; } resetEndPort() { this._endPort = undefined; } // Temporarily expose input value. Use with caution. get endPortInput() { return this._endPort; } get port() { return this.getStringAttribute('port'); } set port(value) { this._port = value; } resetPort() { this._port = undefined; } // Temporarily expose input value. Use with caution. get portInput() { return this._port; } get protocol() { return this.getStringAttribute('protocol'); } set protocol(value) { this._protocol = value; } resetProtocol() { this._protocol = undefined; } // Temporarily expose input value. Use with caution. get protocolInput() { return this._protocol; } } exports.NetworkPolicySpecEgressPortsOutputReference = NetworkPolicySpecEgressPortsOutputReference; _b = JSII_RTTI_SYMBOL_1; NetworkPolicySpecEgressPortsOutputReference[_b] = { fqn: "@cdktf/provider-kubernetes.networkPolicy.NetworkPolicySpecEgressPortsOutputReference", version: "12.0.0" }; class NetworkPolicySpecEgressPortsList 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 NetworkPolicySpecEgressPortsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); } } exports.NetworkPolicySpecEgressPortsList = NetworkPolicySpecEgressPortsList; _c = JSII_RTTI_SYMBOL_1; NetworkPolicySpecEgressPortsList[_c] = { fqn: "@cdktf/provider-kubernetes.networkPolicy.NetworkPolicySpecEgressPortsList", version: "12.0.0" }; function networkPolicySpecEgressToIpBlockToTerraform(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: cdktf.stringToTerraform(struct.cidr), except: cdktf.listMapper(cdktf.stringToTerraform, false)(struct.except), }; } function networkPolicySpecEgressToIpBlockToHclTerraform(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: { value: cdktf.stringToHclTerraform(struct.cidr), isBlock: false, type: "simple", storageClassType: "string", }, except: { value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct.except), isBlock: false, type: "list", storageClassType: "stringList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class NetworkPolicySpecEgressToIpBlockOutputReference 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._cidr !== undefined) { hasAnyValues = true; internalValueResult.cidr = this._cidr; } if (this._except !== undefined) { hasAnyValues = true; internalValueResult.except = this._except; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._cidr = undefined; this._except = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._cidr = value.cidr; this._except = value.except; } } get cidr() { return this.getStringAttribute('cidr'); } set cidr(value) { this._cidr = value; } resetCidr() { this._cidr = undefined; } // Temporarily expose input value. Use with caution. get cidrInput() { return this._cidr; } get except() { return this.getListAttribute('except'); } set except(value) { this._except = value; } resetExcept() { this._except = undefined; } // Temporarily expose input value. Use with caution. get exceptInput() { return this._except; } } exports.NetworkPolicySpecEgressToIpBlockOutputReference = NetworkPolicySpecEgressToIpBlockOutputReference; _d = JSII_RTTI_SYMBOL_1; NetworkPolicySpecEgressToIpBlockOutputReference[_d] = { fqn: "@cdktf/provider-kubernetes.networkPolicy.NetworkPolicySpecEgressToIpBlockOutputReference", version: "12.0.0" }; function networkPolicySpecEgressToNamespaceSelectorMatchExpressionsToTerraform(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 { key: cdktf.stringToTerraform(struct.key), operator: cdktf.stringToTerraform(struct.operator), values: cdktf.listMapper(cdktf.stringToTerraform, false)(struct.values), }; } function networkPolicySpecEgressToNamespaceSelectorMatchExpressionsToHclTerraform(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 = { key: { value: cdktf.stringToHclTerraform(struct.key), isBlock: false, type: "simple", storageClassType: "string", }, operator: { value: cdktf.stringToHclTerraform(struct.operator), isBlock: false, type: "simple", storageClassType: "string", }, values: { value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct.values), isBlock: false, type: "set", storageClassType: "stringList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class NetworkPolicySpecEgressToNamespaceSelectorMatchExpressionsOutputReference 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._key !== undefined) { hasAnyValues = true; internalValueResult.key = this._key; } if (this._operator !== undefined) { hasAnyValues = true; internalValueResult.operator = this._operator; } if (this._values !== undefined) { hasAnyValues = true; internalValueResult.values = this._values; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this.resolvableValue = undefined; this._key = undefined; this._operator = undefined; this._values = 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._key = value.key; this._operator = value.operator; this._values = value.values; } } get key() { return this.getStringAttribute('key'); } set key(value) { this._key = value; } resetKey() { this._key = undefined; } // Temporarily expose input value. Use with caution. get keyInput() { return this._key; } get operator() { return this.getStringAttribute('operator'); } set operator(value) { this._operator = value; } resetOperator() { this._operator = undefined; } // Temporarily expose input value. Use with caution. get operatorInput() { return this._operator; } get values() { return cdktf.Fn.tolist(this.getListAttribute('values')); } set values(value) { this._values = value; } resetValues() { this._values = undefined; } // Temporarily expose input value. Use with caution. get valuesInput() { return this._values; } } exports.NetworkPolicySpecEgressToNamespaceSelectorMatchExpressionsOutputReference = NetworkPolicySpecEgressToNamespaceSelectorMatchExpressionsOutputReference; _e = JSII_RTTI_SYMBOL_1; NetworkPolicySpecEgressToNamespaceSelectorMatchExpressionsOutputReference[_e] = { fqn: "@cdktf/provider-kubernetes.networkPolicy.NetworkPolicySpecEgressToNamespaceSelectorMatchExpressionsOutputReference", version: "12.0.0" }; class NetworkPolicySpecEgressToNamespaceSelectorMatchExpressionsList 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 NetworkPolicySpecEgressToNamespaceSelectorMatchExpressionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); } } exports.NetworkPolicySpecEgressToNamespaceSelectorMatchExpressionsList = NetworkPolicySpecEgressToNamespaceSelectorMatchExpressionsList; _f = JSII_RTTI_SYMBOL_1; NetworkPolicySpecEgressToNamespaceSelectorMatchExpressionsList[_f] = { fqn: "@cdktf/provider-kubernetes.networkPolicy.NetworkPolicySpecEgressToNamespaceSelectorMatchExpressionsList", version: "12.0.0" }; function networkPolicySpecEgressToNamespaceSelectorToTerraform(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 { match_labels: cdktf.hashMapper(cdktf.stringToTerraform)(struct.matchLabels), match_expressions: cdktf.listMapper(networkPolicySpecEgressToNamespaceSelectorMatchExpressionsToTerraform, true)(struct.matchExpressions), }; } function networkPolicySpecEgressToNamespaceSelectorToHclTerraform(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 = { match_labels: { value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct.matchLabels), isBlock: false, type: "map", storageClassType: "stringMap", }, match_expressions: { value: cdktf.listMapperHcl(networkPolicySpecEgressToNamespaceSelectorMatchExpressionsToHclTerraform, true)(struct.matchExpressions), isBlock: true, type: "list", storageClassType: "NetworkPolicySpecEgressToNamespaceSelectorMatchExpressionsList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class NetworkPolicySpecEgressToNamespaceSelectorOutputReference 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; // match_expressions - computed: false, optional: true, required: false this._matchExpressions = new NetworkPolicySpecEgressToNamespaceSelectorMatchExpressionsList(this, "match_expressions", false); } get internalValue() { let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._matchLabels !== undefined) { hasAnyValues = true; internalValueResult.matchLabels = this._matchLabels; } if (this._matchExpressions?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.matchExpressions = this._matchExpressions?.internalValue; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._matchLabels = undefined; this._matchExpressions.internalValue = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._matchLabels = value.matchLabels; this._matchExpressions.internalValue = value.matchExpressions; } } get matchLabels() { return this.getStringMapAttribute('match_labels'); } set matchLabels(value) { this._matchLabels = value; } resetMatchLabels() { this._matchLabels = undefined; } // Temporarily expose input value. Use with caution. get matchLabelsInput() { return this._matchLabels; } get matchExpressions() { return this._matchExpressions; } putMatchExpressions(value) { this._matchExpressions.internalValue = value; } resetMatchExpressions() { this._matchExpressions.internalValue = undefined; } // Temporarily expose input value. Use with caution. get matchExpressionsInput() { return this._matchExpressions.internalValue; } } exports.NetworkPolicySpecEgressToNamespaceSelectorOutputReference = NetworkPolicySpecEgressToNamespaceSelectorOutputReference; _g = JSII_RTTI_SYMBOL_1; NetworkPolicySpecEgressToNamespaceSelectorOutputReference[_g] = { fqn: "@cdktf/provider-kubernetes.networkPolicy.NetworkPolicySpecEgressToNamespaceSelectorOutputReference", version: "12.0.0" }; function networkPolicySpecEgressToPodSelectorMatchExpressionsToTerraform(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 { key: cdktf.stringToTerraform(struct.key), operator: cdktf.stringToTerraform(struct.operator), values: cdktf.listMapper(cdktf.stringToTerraform, false)(struct.values), }; } function networkPolicySpecEgressToPodSelectorMatchExpressionsToHclTerraform(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 = { key: { value: cdktf.stringToHclTerraform(struct.key), isBlock: false, type: "simple", storageClassType: "string", }, operator: { value: cdktf.stringToHclTerraform(struct.operator), isBlock: false, type: "simple", storageClassType: "string", }, values: { value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct.values), isBlock: false, type: "set", storageClassType: "stringList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class NetworkPolicySpecEgressToPodSelectorMatchExpressionsOutputReference 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._key !== undefined) { hasAnyValues = true; internalValueResult.key = this._key; } if (this._operator !== undefined) { hasAnyValues = true; internalValueResult.operator = this._operator; } if (this._values !== undefined) { hasAnyValues = true; internalValueResult.values = this._values; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this.resolvableValue = undefined; this._key = undefined; this._operator = undefined; this._values = 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._key = value.key; this._operator = value.operator; this._values = value.values; } } get key() { return this.getStringAttribute('key'); } set key(value) { this._key = value; } resetKey() { this._key = undefined; } // Temporarily expose input value. Use with caution. get keyInput() { return this._key; } get operator() { return this.getStringAttribute('operator'); } set operator(value) { this._operator = value; } resetOperator() { this._operator = undefined; } // Temporarily expose input value. Use with caution. get operatorInput() { return this._operator; } get values() { return cdktf.Fn.tolist(this.getListAttribute('values')); } set values(value) { this._values = value; } resetValues() { this._values = undefined; } // Temporarily expose input value. Use with caution. get valuesInput() { return this._values; } } exports.NetworkPolicySpecEgressToPodSelectorMatchExpressionsOutputReference = NetworkPolicySpecEgressToPodSelectorMatchExpressionsOutputReference; _h = JSII_RTTI_SYMBOL_1; NetworkPolicySpecEgressToPodSelectorMatchExpressionsOutputReference[_h] = { fqn: "@cdktf/provider-kubernetes.networkPolicy.NetworkPolicySpecEgressToPodSelectorMatchExpressionsOutputReference", version: "12.0.0" }; class NetworkPolicySpecEgressToPodSelectorMatchExpressionsList 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 NetworkPolicySpecEgressToPodSelectorMatchExpressionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); } } exports.NetworkPolicySpecEgressToPodSelectorMatchExpressionsList = NetworkPolicySpecEgressToPodSelectorMatchExpressionsList; _j = JSII_RTTI_SYMBOL_1; NetworkPolicySpecEgressToPodSelectorMatchExpressionsList[_j] = { fqn: "@cdktf/provider-kubernetes.networkPolicy.NetworkPolicySpecEgressToPodSelectorMatchExpressionsList", version: "12.0.0" }; function networkPolicySpecEgressToPodSelectorToTerraform(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 { match_labels: cdktf.hashMapper(cdktf.stringToTerraform)(struct.matchLabels), match_expressions: cdktf.listMapper(networkPolicySpecEgressToPodSelectorMatchExpressionsToTerraform, true)(struct.matchExpressions), }; } function networkPolicySpecEgressToPodSelectorToHclTerraform(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 = { match_labels: { value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct.matchLabels), isBlock: false, type: "map", storageClassType: "stringMap", }, match_expressions: { value: cdktf.listMapperHcl(networkPolicySpecEgressToPodSelectorMatchExpressionsToHclTerraform, true)(struct.matchExpressions), isBlock: true, type: "list", storageClassType: "NetworkPolicySpecEgressToPodSelectorMatchExpressionsList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class NetworkPolicySpecEgressToPodSelectorOutputReference 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; // match_expressions - computed: false, optional: true, required: false this._matchExpressions = new NetworkPolicySpecEgressToPodSelectorMatchExpressionsList(this, "match_expressions", false); } get internalValue() { let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._matchLabels !== undefined) { hasAnyValues = true; internalValueResult.matchLabels = this._matchLabels; } if (this._matchExpressions?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.matchExpressions = this._matchExpressions?.internalValue; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._matchLabels = undefined; this._matchExpressions.internalValue = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._matchLabels = value.matchLabels; this._matchExpressions.internalValue = value.matchExpressions; } } get matchLabels() { return this.getStringMapAttribute('match_labels'); } set matchLabels(value) { this._matchLabels = value; } resetMatchLabels() { this._matchLabels = undefined; } // Temporarily expose input value. Use with caution. get matchLabelsInput() { return this._matchLabels; } get matchExpressions() { return this._matchExpressions; } putMatchExpressions(value) { this._matchExpressions.internalValue = value; } resetMatchExpressions() { this._matchExpressions.internalValue = undefined; } // Temporarily expose input value. Use with caution. get matchExpressionsInput() { return this._matchExpressions.internalValue; } } exports.NetworkPolicySpecEgressToPodSelectorOutputReference = NetworkPolicySpecEgressToPodSelectorOutputReference; _k = JSII_RTTI_SYMBOL_1; NetworkPolicySpecEgressToPodSelectorOutputReference[_k] = { fqn: "@cdktf/provider-kubernetes.networkPolicy.NetworkPolicySpecEgressToPodSelectorOutputReference", version: "12.0.0" }; function networkPolicySpecEgressToToTerraform(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 { ip_block: networkPolicySpecEgressToIpBlockToTerraform(struct.ipBlock), namespace_selector: networkPolicySpecEgressToNamespaceSelectorToTerraform(struct.namespaceSelector), pod_selector: networkPolicySpecEgressToPodSelectorToTerraform(struct.podSelector), }; } function networkPolicySpecEgressToToHclTerraform(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 = { ip_block: { value: networkPolicySpecEgressToIpBlockToHclTerraform(struct.ipBlock), isBlock: true, type: "list", storageClassType: "NetworkPolicySpecEgressToIpBlockList", }, namespace_selector: { value: networkPolicySpecEgressToNamespaceSelectorToHclTerraform(struct.namespaceSelector), isBlock: true, type: "list", storageClassType: "NetworkPolicySpecEgressToNamespaceSelectorList", }, pod_selector: { value: networkPolicySpecEgressToPodSelectorToHclTerraform(struct.podSelector), isBlock: true, type: "list", storageClassType: "NetworkPolicySpecEgressToPodSelectorList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class NetworkPolicySpecEgressToOutputReference 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; // ip_block - computed: false, optional: true, required: false this._ipBlock = new NetworkPolicySpecEgressToIpBlockOutputReference(this, "ip_block"); // namespace_selector - computed: false, optional: true, required: false this._namespaceSelector = new NetworkPolicySpecEgressToNamespaceSelectorOutputReference(this, "namespace_selector"); // pod_selector - computed: false, optional: true, required: false this._podSelector = new NetworkPolicySpecEgressToPodSelectorOutputReference(this, "pod_selector"); } get internalValue() { if (this.resolvableValue) { return this.resolvableValue; } let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._ipBlock?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.ipBlock = this._ipBlock?.internalValue; } if (this._namespaceSelector?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.namespaceSelector = this._namespaceSelector?.internalValue; } if (this._podSelector?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.podSelector = this._podSelector?.internalValue; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this.resolvableValue = undefined; this._ipBlock.internalValue = undefined; this._namespaceSelector.internalValue = undefined; this._podSelector.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._ipBlock.internalValue = value.ipBlock; this._namespaceSelector.internalValue = value.namespaceSelector; this._podSelector.internalValue = value.podSelector; } } get ipBlock() { return this._ipBlock; } putIpBlock(value) { this._ipBlock.internalValue = value; } resetIpBlock() { this._ipBlock.internalValue = undefined; } // Temporarily expose input value. Use with caution. get ipBlockInput() { return this._ipBlock.internalValue; } get namespaceSelector() { return this._namespaceSelector; } putNamespaceSelector(value) { this._namespaceSelector.internalValue = value;