KubernetesObjectValue
- class aws_cdk.aws_eks_v2_alpha.KubernetesObjectValue(scope, id, *, cluster, json_path, object_name, object_type, object_namespace=None, timeout=None)
 Bases:
Construct(experimental) Represents a value of a specific object deployed in the cluster.
Use this to fetch any information available by the
kubectl getcommand.- Stability:
 experimental
- ExampleMetadata:
 infused
Example:
# cluster: eks.Cluster # query the load balancer address my_service_address = eks.KubernetesObjectValue(self, "LoadBalancerAttribute", cluster=cluster, object_type="service", object_name="my-service", json_path=".status.loadBalancer.ingress[0].hostname" ) # pass the address to a lambda function proxy_function = lambda_.Function(self, "ProxyFunction", handler="index.handler", code=lambda_.Code.from_inline("my-code"), runtime=lambda_.Runtime.NODEJS_LATEST, environment={ "my_service_address": my_service_address.value } )
- Parameters:
 scope (
Construct)id (
str)cluster (
ICluster) – (experimental) The EKS cluster to fetch attributes from. [disable-awslint:ref-via-interface]json_path (
str) – (experimental) JSONPath to the specific value.object_name (
str) – (experimental) The name of the object to query.object_type (
str) – (experimental) The object type to query. (e.g ‘service’, ‘pod’…)object_namespace (
Optional[str]) – (experimental) The namespace the object belongs to. Default: ‘default’timeout (
Optional[Duration]) – (experimental) Timeout for waiting on a value. Default: Duration.minutes(5)
- Stability:
 experimental
Methods
- to_string()
 Returns a string representation of this construct.
- Return type:
 str
Attributes
- RESOURCE_TYPE = 'Custom::AWSCDK-EKS-KubernetesObjectValue'
 
- node
 The tree node.
- value
 (experimental) The value as a string token.
- Stability:
 experimental
Static Methods
- classmethod is_construct(x)
 Checks if
xis a construct.Use this method instead of
instanceofto properly detectConstructinstances, even when the construct library is symlinked.Explanation: in JavaScript, multiple copies of the
constructslibrary on disk are seen as independent, completely different libraries. As a consequence, the classConstructin each copy of theconstructslibrary is seen as a different class, and an instance of one class will not test asinstanceofthe other class.npm installwill not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of theconstructslibrary can be accidentally installed, andinstanceofwill behave unpredictably. It is safest to avoid usinginstanceof, and using this type-testing method instead.- Parameters:
 x (
Any) – Any object.- Return type:
 bool- Returns:
 true if
xis an object created from a class which extendsConstruct.