Class KubernetesObjectValue

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.services.eks.KubernetesObjectValue
All Implemented Interfaces:
IConstruct, IDependable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:46.640Z") @Stability(Stable) public class KubernetesObjectValue extends Construct
Represents a value of a specific object deployed in the cluster.

Use this to fetch any information available by the kubectl get command.

Example:

 Cluster cluster;
 // query the load balancer address
 KubernetesObjectValue myServiceAddress = KubernetesObjectValue.Builder.create(this, "LoadBalancerAttribute")
         .cluster(cluster)
         .objectType("service")
         .objectName("my-service")
         .jsonPath(".status.loadBalancer.ingress[0].hostname")
         .build();
 // pass the address to a lambda function
 Function proxyFunction = Function.Builder.create(this, "ProxyFunction")
         .handler("index.handler")
         .code(Code.fromInline("my-code"))
         .runtime(Runtime.NODEJS_14_X)
         .environment(Map.of(
                 "myServiceAddress", myServiceAddress.getValue()))
         .build();
 
  • Field Details

    • RESOURCE_TYPE

      @Stability(Stable) public static final String RESOURCE_TYPE
      The CloudFormation reosurce type.
  • Constructor Details

    • KubernetesObjectValue

      protected KubernetesObjectValue(software.amazon.jsii.JsiiObjectRef objRef)
    • KubernetesObjectValue

      protected KubernetesObjectValue(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • KubernetesObjectValue

      @Stability(Stable) public KubernetesObjectValue(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull KubernetesObjectValueProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • getValue

      @Stability(Stable) @NotNull public String getValue()
      The value as a string token.