@cdktf/provider-kubernetes
Version:
Prebuilt kubernetes Provider for Terraform CDK (cdktf)
1,121 lines • 422 kB
JavaScript
"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.NetworkPolicyV1 = exports.NetworkPolicyV1SpecOutputReference = exports.NetworkPolicyV1SpecPodSelectorOutputReference = exports.NetworkPolicyV1SpecPodSelectorMatchExpressionsList = exports.NetworkPolicyV1SpecPodSelectorMatchExpressionsOutputReference = exports.NetworkPolicyV1SpecIngressList = exports.NetworkPolicyV1SpecIngressOutputReference = exports.NetworkPolicyV1SpecIngressPortsList = exports.NetworkPolicyV1SpecIngressPortsOutputReference = exports.NetworkPolicyV1SpecIngressFromList = exports.NetworkPolicyV1SpecIngressFromOutputReference = exports.NetworkPolicyV1SpecIngressFromPodSelectorOutputReference = exports.NetworkPolicyV1SpecIngressFromPodSelectorMatchExpressionsList = exports.NetworkPolicyV1SpecIngressFromPodSelectorMatchExpressionsOutputReference = exports.NetworkPolicyV1SpecIngressFromNamespaceSelectorOutputReference = exports.NetworkPolicyV1SpecIngressFromNamespaceSelectorMatchExpressionsList = exports.NetworkPolicyV1SpecIngressFromNamespaceSelectorMatchExpressionsOutputReference = exports.NetworkPolicyV1SpecIngressFromIpBlockOutputReference = exports.NetworkPolicyV1SpecEgressList = exports.NetworkPolicyV1SpecEgressOutputReference = exports.NetworkPolicyV1SpecEgressToList = exports.NetworkPolicyV1SpecEgressToOutputReference = exports.NetworkPolicyV1SpecEgressToPodSelectorOutputReference = exports.NetworkPolicyV1SpecEgressToPodSelectorMatchExpressionsList = exports.NetworkPolicyV1SpecEgressToPodSelectorMatchExpressionsOutputReference = exports.NetworkPolicyV1SpecEgressToNamespaceSelectorOutputReference = exports.NetworkPolicyV1SpecEgressToNamespaceSelectorMatchExpressionsList = exports.NetworkPolicyV1SpecEgressToNamespaceSelectorMatchExpressionsOutputReference = exports.NetworkPolicyV1SpecEgressToIpBlockOutputReference = exports.NetworkPolicyV1SpecEgressPortsList = exports.NetworkPolicyV1SpecEgressPortsOutputReference = exports.NetworkPolicyV1MetadataOutputReference = void 0;
exports.networkPolicyV1MetadataToTerraform = networkPolicyV1MetadataToTerraform;
exports.networkPolicyV1MetadataToHclTerraform = networkPolicyV1MetadataToHclTerraform;
exports.networkPolicyV1SpecEgressPortsToTerraform = networkPolicyV1SpecEgressPortsToTerraform;
exports.networkPolicyV1SpecEgressPortsToHclTerraform = networkPolicyV1SpecEgressPortsToHclTerraform;
exports.networkPolicyV1SpecEgressToIpBlockToTerraform = networkPolicyV1SpecEgressToIpBlockToTerraform;
exports.networkPolicyV1SpecEgressToIpBlockToHclTerraform = networkPolicyV1SpecEgressToIpBlockToHclTerraform;
exports.networkPolicyV1SpecEgressToNamespaceSelectorMatchExpressionsToTerraform = networkPolicyV1SpecEgressToNamespaceSelectorMatchExpressionsToTerraform;
exports.networkPolicyV1SpecEgressToNamespaceSelectorMatchExpressionsToHclTerraform = networkPolicyV1SpecEgressToNamespaceSelectorMatchExpressionsToHclTerraform;
exports.networkPolicyV1SpecEgressToNamespaceSelectorToTerraform = networkPolicyV1SpecEgressToNamespaceSelectorToTerraform;
exports.networkPolicyV1SpecEgressToNamespaceSelectorToHclTerraform = networkPolicyV1SpecEgressToNamespaceSelectorToHclTerraform;
exports.networkPolicyV1SpecEgressToPodSelectorMatchExpressionsToTerraform = networkPolicyV1SpecEgressToPodSelectorMatchExpressionsToTerraform;
exports.networkPolicyV1SpecEgressToPodSelectorMatchExpressionsToHclTerraform = networkPolicyV1SpecEgressToPodSelectorMatchExpressionsToHclTerraform;
exports.networkPolicyV1SpecEgressToPodSelectorToTerraform = networkPolicyV1SpecEgressToPodSelectorToTerraform;
exports.networkPolicyV1SpecEgressToPodSelectorToHclTerraform = networkPolicyV1SpecEgressToPodSelectorToHclTerraform;
exports.networkPolicyV1SpecEgressToToTerraform = networkPolicyV1SpecEgressToToTerraform;
exports.networkPolicyV1SpecEgressToToHclTerraform = networkPolicyV1SpecEgressToToHclTerraform;
exports.networkPolicyV1SpecEgressToTerraform = networkPolicyV1SpecEgressToTerraform;
exports.networkPolicyV1SpecEgressToHclTerraform = networkPolicyV1SpecEgressToHclTerraform;
exports.networkPolicyV1SpecIngressFromIpBlockToTerraform = networkPolicyV1SpecIngressFromIpBlockToTerraform;
exports.networkPolicyV1SpecIngressFromIpBlockToHclTerraform = networkPolicyV1SpecIngressFromIpBlockToHclTerraform;
exports.networkPolicyV1SpecIngressFromNamespaceSelectorMatchExpressionsToTerraform = networkPolicyV1SpecIngressFromNamespaceSelectorMatchExpressionsToTerraform;
exports.networkPolicyV1SpecIngressFromNamespaceSelectorMatchExpressionsToHclTerraform = networkPolicyV1SpecIngressFromNamespaceSelectorMatchExpressionsToHclTerraform;
exports.networkPolicyV1SpecIngressFromNamespaceSelectorToTerraform = networkPolicyV1SpecIngressFromNamespaceSelectorToTerraform;
exports.networkPolicyV1SpecIngressFromNamespaceSelectorToHclTerraform = networkPolicyV1SpecIngressFromNamespaceSelectorToHclTerraform;
exports.networkPolicyV1SpecIngressFromPodSelectorMatchExpressionsToTerraform = networkPolicyV1SpecIngressFromPodSelectorMatchExpressionsToTerraform;
exports.networkPolicyV1SpecIngressFromPodSelectorMatchExpressionsToHclTerraform = networkPolicyV1SpecIngressFromPodSelectorMatchExpressionsToHclTerraform;
exports.networkPolicyV1SpecIngressFromPodSelectorToTerraform = networkPolicyV1SpecIngressFromPodSelectorToTerraform;
exports.networkPolicyV1SpecIngressFromPodSelectorToHclTerraform = networkPolicyV1SpecIngressFromPodSelectorToHclTerraform;
exports.networkPolicyV1SpecIngressFromToTerraform = networkPolicyV1SpecIngressFromToTerraform;
exports.networkPolicyV1SpecIngressFromToHclTerraform = networkPolicyV1SpecIngressFromToHclTerraform;
exports.networkPolicyV1SpecIngressPortsToTerraform = networkPolicyV1SpecIngressPortsToTerraform;
exports.networkPolicyV1SpecIngressPortsToHclTerraform = networkPolicyV1SpecIngressPortsToHclTerraform;
exports.networkPolicyV1SpecIngressToTerraform = networkPolicyV1SpecIngressToTerraform;
exports.networkPolicyV1SpecIngressToHclTerraform = networkPolicyV1SpecIngressToHclTerraform;
exports.networkPolicyV1SpecPodSelectorMatchExpressionsToTerraform = networkPolicyV1SpecPodSelectorMatchExpressionsToTerraform;
exports.networkPolicyV1SpecPodSelectorMatchExpressionsToHclTerraform = networkPolicyV1SpecPodSelectorMatchExpressionsToHclTerraform;
exports.networkPolicyV1SpecPodSelectorToTerraform = networkPolicyV1SpecPodSelectorToTerraform;
exports.networkPolicyV1SpecPodSelectorToHclTerraform = networkPolicyV1SpecPodSelectorToHclTerraform;
exports.networkPolicyV1SpecToTerraform = networkPolicyV1SpecToTerraform;
exports.networkPolicyV1SpecToHclTerraform = networkPolicyV1SpecToHclTerraform;
const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
const cdktf = require("cdktf");
function networkPolicyV1MetadataToTerraform(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 networkPolicyV1MetadataToHclTerraform(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 NetworkPolicyV1MetadataOutputReference 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.NetworkPolicyV1MetadataOutputReference = NetworkPolicyV1MetadataOutputReference;
_a = JSII_RTTI_SYMBOL_1;
NetworkPolicyV1MetadataOutputReference[_a] = { fqn: "@cdktf/provider-kubernetes.networkPolicyV1.NetworkPolicyV1MetadataOutputReference", version: "12.0.0" };
function networkPolicyV1SpecEgressPortsToTerraform(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 networkPolicyV1SpecEgressPortsToHclTerraform(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 NetworkPolicyV1SpecEgressPortsOutputReference 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.NetworkPolicyV1SpecEgressPortsOutputReference = NetworkPolicyV1SpecEgressPortsOutputReference;
_b = JSII_RTTI_SYMBOL_1;
NetworkPolicyV1SpecEgressPortsOutputReference[_b] = { fqn: "@cdktf/provider-kubernetes.networkPolicyV1.NetworkPolicyV1SpecEgressPortsOutputReference", version: "12.0.0" };
class NetworkPolicyV1SpecEgressPortsList 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 NetworkPolicyV1SpecEgressPortsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet);
}
}
exports.NetworkPolicyV1SpecEgressPortsList = NetworkPolicyV1SpecEgressPortsList;
_c = JSII_RTTI_SYMBOL_1;
NetworkPolicyV1SpecEgressPortsList[_c] = { fqn: "@cdktf/provider-kubernetes.networkPolicyV1.NetworkPolicyV1SpecEgressPortsList", version: "12.0.0" };
function networkPolicyV1SpecEgressToIpBlockToTerraform(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 networkPolicyV1SpecEgressToIpBlockToHclTerraform(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 NetworkPolicyV1SpecEgressToIpBlockOutputReference 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.NetworkPolicyV1SpecEgressToIpBlockOutputReference = NetworkPolicyV1SpecEgressToIpBlockOutputReference;
_d = JSII_RTTI_SYMBOL_1;
NetworkPolicyV1SpecEgressToIpBlockOutputReference[_d] = { fqn: "@cdktf/provider-kubernetes.networkPolicyV1.NetworkPolicyV1SpecEgressToIpBlockOutputReference", version: "12.0.0" };
function networkPolicyV1SpecEgressToNamespaceSelectorMatchExpressionsToTerraform(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 networkPolicyV1SpecEgressToNamespaceSelectorMatchExpressionsToHclTerraform(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 NetworkPolicyV1SpecEgressToNamespaceSelectorMatchExpressionsOutputReference 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.NetworkPolicyV1SpecEgressToNamespaceSelectorMatchExpressionsOutputReference = NetworkPolicyV1SpecEgressToNamespaceSelectorMatchExpressionsOutputReference;
_e = JSII_RTTI_SYMBOL_1;
NetworkPolicyV1SpecEgressToNamespaceSelectorMatchExpressionsOutputReference[_e] = { fqn: "@cdktf/provider-kubernetes.networkPolicyV1.NetworkPolicyV1SpecEgressToNamespaceSelectorMatchExpressionsOutputReference", version: "12.0.0" };
class NetworkPolicyV1SpecEgressToNamespaceSelectorMatchExpressionsList 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 NetworkPolicyV1SpecEgressToNamespaceSelectorMatchExpressionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet);
}
}
exports.NetworkPolicyV1SpecEgressToNamespaceSelectorMatchExpressionsList = NetworkPolicyV1SpecEgressToNamespaceSelectorMatchExpressionsList;
_f = JSII_RTTI_SYMBOL_1;
NetworkPolicyV1SpecEgressToNamespaceSelectorMatchExpressionsList[_f] = { fqn: "@cdktf/provider-kubernetes.networkPolicyV1.NetworkPolicyV1SpecEgressToNamespaceSelectorMatchExpressionsList", version: "12.0.0" };
function networkPolicyV1SpecEgressToNamespaceSelectorToTerraform(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(networkPolicyV1SpecEgressToNamespaceSelectorMatchExpressionsToTerraform, true)(struct.matchExpressions),
};
}
function networkPolicyV1SpecEgressToNamespaceSelectorToHclTerraform(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(networkPolicyV1SpecEgressToNamespaceSelectorMatchExpressionsToHclTerraform, true)(struct.matchExpressions),
isBlock: true,
type: "list",
storageClassType: "NetworkPolicyV1SpecEgressToNamespaceSelectorMatchExpressionsList",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class NetworkPolicyV1SpecEgressToNamespaceSelectorOutputReference 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 NetworkPolicyV1SpecEgressToNamespaceSelectorMatchExpressionsList(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.NetworkPolicyV1SpecEgressToNamespaceSelectorOutputReference = NetworkPolicyV1SpecEgressToNamespaceSelectorOutputReference;
_g = JSII_RTTI_SYMBOL_1;
NetworkPolicyV1SpecEgressToNamespaceSelectorOutputReference[_g] = { fqn: "@cdktf/provider-kubernetes.networkPolicyV1.NetworkPolicyV1SpecEgressToNamespaceSelectorOutputReference", version: "12.0.0" };
function networkPolicyV1SpecEgressToPodSelectorMatchExpressionsToTerraform(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 networkPolicyV1SpecEgressToPodSelectorMatchExpressionsToHclTerraform(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 NetworkPolicyV1SpecEgressToPodSelectorMatchExpressionsOutputReference 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.NetworkPolicyV1SpecEgressToPodSelectorMatchExpressionsOutputReference = NetworkPolicyV1SpecEgressToPodSelectorMatchExpressionsOutputReference;
_h = JSII_RTTI_SYMBOL_1;
NetworkPolicyV1SpecEgressToPodSelectorMatchExpressionsOutputReference[_h] = { fqn: "@cdktf/provider-kubernetes.networkPolicyV1.NetworkPolicyV1SpecEgressToPodSelectorMatchExpressionsOutputReference", version: "12.0.0" };
class NetworkPolicyV1SpecEgressToPodSelectorMatchExpressionsList 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 NetworkPolicyV1SpecEgressToPodSelectorMatchExpressionsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet);
}
}
exports.NetworkPolicyV1SpecEgressToPodSelectorMatchExpressionsList = NetworkPolicyV1SpecEgressToPodSelectorMatchExpressionsList;
_j = JSII_RTTI_SYMBOL_1;
NetworkPolicyV1SpecEgressToPodSelectorMatchExpressionsList[_j] = { fqn: "@cdktf/provider-kubernetes.networkPolicyV1.NetworkPolicyV1SpecEgressToPodSelectorMatchExpressionsList", version: "12.0.0" };
function networkPolicyV1SpecEgressToPodSelectorToTerraform(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(networkPolicyV1SpecEgressToPodSelectorMatchExpressionsToTerraform, true)(struct.matchExpressions),
};
}
function networkPolicyV1SpecEgressToPodSelectorToHclTerraform(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(networkPolicyV1SpecEgressToPodSelectorMatchExpressionsToHclTerraform, true)(struct.matchExpressions),
isBlock: true,
type: "list",
storageClassType: "NetworkPolicyV1SpecEgressToPodSelectorMatchExpressionsList",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class NetworkPolicyV1SpecEgressToPodSelectorOutputReference 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 NetworkPolicyV1SpecEgressToPodSelectorMatchExpressionsList(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.NetworkPolicyV1SpecEgressToPodSelectorOutputReference = NetworkPolicyV1SpecEgressToPodSelectorOutputReference;
_k = JSII_RTTI_SYMBOL_1;
NetworkPolicyV1SpecEgressToPodSelectorOutputReference[_k] = { fqn: "@cdktf/provider-kubernetes.networkPolicyV1.NetworkPolicyV1SpecEgressToPodSelectorOutputReference", version: "12.0.0" };
function networkPolicyV1SpecEgressToToTerraform(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: networkPolicyV1SpecEgressToIpBlockToTerraform(struct.ipBlock),
namespace_selector: networkPolicyV1SpecEgressToNamespaceSelectorToTerraform(struct.namespaceSelector),
pod_selector: networkPolicyV1SpecEgressToPodSelectorToTerraform(struct.podSelector),
};
}
function networkPolicyV1SpecEgressToToHclTerraform(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: networkPolicyV1SpecEgressToIpBlockToHclTerraform(struct.ipBlock),
isBlock: true,
type: "list",
storageClassType: "NetworkPolicyV1SpecEgressToIpBlockList",
},
namespace_selector: {
value: networkPolicyV1SpecEgressToNamespaceSelectorToHclTerraform(struct.namespaceSelector),
isBlock: true,
type: "list",
storageClassType: "NetworkPolicyV1SpecEgressToNamespaceSelectorList",
},
pod_selector: {
value: networkPolicyV1SpecEgressToPodSelectorToHclTerraform(struct.podSelector),
isBlock: true,
type: "list",
storageClassType: "NetworkPolicyV1SpecEgressToPodSelectorList",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class NetworkPolicyV1SpecEgressToOutputReference 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 NetworkPolicyV1SpecEgressToIpBlockOutputReference(this, "ip_block");
// namespace_selector - computed: false, optional: true, required: false
this._namespaceSelector = new NetworkPolicyV1SpecEgressToNamespaceSelectorOutputReference(this, "namespace_selector");
// pod_selector - computed: false, optional: true, required: false
this._podSelector = new NetworkPolicyV1SpecEgressToPodSelectorOutputReference(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) {