"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.KubernetesObjectValue=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),core_1=require("../../core"),constructs_1=require("constructs"),kubectl_provider_1=require("./kubectl-provider");class KubernetesObjectValue extends constructs_1.Construct{constructor(scope,id,props){var _b,_c;super(scope,id);try{jsiiDeprecationWarnings.aws_cdk_lib_aws_eks_KubernetesObjectValueProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.constructor),error}const provider=kubectl_provider_1.KubectlProvider.getOrCreate(this,props.cluster);this._resource=new core_1.CustomResource(this,"Resource",{resourceType:KubernetesObjectValue.RESOURCE_TYPE,serviceToken:provider.serviceToken,properties:{ClusterName:props.cluster.clusterName,RoleArn:provider.roleArn,ObjectType:props.objectType,ObjectName:props.objectName,ObjectNamespace:(_b=props.objectNamespace)!==null&&_b!==void 0?_b:"default",JsonPath:props.jsonPath,TimeoutSeconds:((_c=props==null?void 0:props.timeout)!==null&&_c!==void 0?_c:core_1.Duration.minutes(5)).toSeconds()}})}get value(){return core_1.Token.asString(this._resource.getAtt("Value"))}}exports.KubernetesObjectValue=KubernetesObjectValue,_a=JSII_RTTI_SYMBOL_1,KubernetesObjectValue[_a]={fqn:"aws-cdk-lib.aws_eks.KubernetesObjectValue",version:"2.21.0"},KubernetesObjectValue.RESOURCE_TYPE="Custom::AWSCDK-EKS-KubernetesObjectValue";
//# sourceMappingURL=k8s-object-value.js.map
